mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] add support for polls + receiving federated status edits (#2330)
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
|
||||
"github.com/superseriousbusiness/activity/streams"
|
||||
"github.com/superseriousbusiness/activity/streams/vocab"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
)
|
||||
|
||||
// MustGet performs the given 'Get$Property(with) (T, error)' signature function, panicking on error.
|
||||
@@ -36,12 +37,12 @@ import (
|
||||
// }
|
||||
|
||||
// MustSet performs the given 'Set$Property(with, T) error' signature function, panicking on error.
|
||||
// func MustSet[W, T any](fn func(W, T) error, with W, value T) {
|
||||
// err := fn(with, value)
|
||||
// if err != nil {
|
||||
// panicfAt(3, "error setting property on %T: %w", with, err)
|
||||
// }
|
||||
// }
|
||||
func MustSet[W, T any](fn func(W, T) error, with W, value T) {
|
||||
err := fn(with, value)
|
||||
if err != nil {
|
||||
panicfAt(3, "error setting property on %T: %w", with, err)
|
||||
}
|
||||
}
|
||||
|
||||
// AppendSet performs the given 'Append$Property(with, ...T) error' signature function, panicking on error.
|
||||
// func MustAppend[W, T any](fn func(W, ...T) error, with W, values ...T) {
|
||||
@@ -320,6 +321,6 @@ func appendIRIs[T TypeOrIRI](getProp func() Property[T], iri ...*url.URL) {
|
||||
}
|
||||
|
||||
// panicfAt panics with a call to gtserror.NewfAt() with given args (+1 to calldepth).
|
||||
// func panicfAt(calldepth int, msg string, args ...any) {
|
||||
// panic(gtserror.NewfAt(calldepth+1, msg, args...))
|
||||
// }
|
||||
func panicfAt(calldepth int, msg string, args ...any) {
|
||||
panic(gtserror.NewfAt(calldepth+1, msg, args...))
|
||||
}
|
||||
|
Reference in New Issue
Block a user