diff options
| author | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:40:47 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:40:47 +0200 |
| commit | 347b20fc91505584bc9efbeca89590a411b95e79 (patch) | |
| tree | 9dfc600e957c4a881115f8bc8a9cc107a4f0cc9c /i18nerr | |
| parent | 9c4985368aee638d982f30ea7bc5c7ee71ae3ab3 (diff) | |
All: Run modernize --test --fix
Diffstat (limited to 'i18nerr')
| -rw-r--r-- | i18nerr/i18nerr.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/i18nerr/i18nerr.go b/i18nerr/i18nerr.go index 47518e7..438b135 100644 --- a/i18nerr/i18nerr.go +++ b/i18nerr/i18nerr.go @@ -45,7 +45,7 @@ func TranslatedInner(inner error) (string, bool) { // The inner error always consists of the translation key and some formatting type Error struct { key message.Reference - args []interface{} + args []any wrapped *Error Misc bool } @@ -121,7 +121,7 @@ func New(key message.Reference) *Error { // Newf creates a new i18n error using a message reference and arguments. // It formats this with fmt.Errorf -func Newf(key message.Reference, args ...interface{}) *Error { +func Newf(key message.Reference, args ...any) *Error { _ = printerOrNew(language.English).Sprintf(key, args...) return &Error{key: key, args: args} } @@ -136,7 +136,7 @@ func Wrap(err error, key message.Reference) *Error { // Wrapf creates a new i18n error using an error to be wrapped 'err' and a prefix message reference 'key' with format arguments 'args'. // It formats this with fmt.Errorf -func Wrapf(err error, key message.Reference, args ...interface{}) *Error { +func Wrapf(err error, key message.Reference, args ...any) *Error { _ = printerOrNew(language.English).Sprintf(key, args...) t, misc := TranslatedInner(err) return &Error{key: key, args: args, wrapped: &Error{key: t, Misc: misc}, Misc: misc} @@ -148,7 +148,7 @@ func NewInternal(disp string) *Error { } // NewInternalf creates an internal localised error from a display string and arguments -func NewInternalf(disp string, args ...interface{}) *Error { +func NewInternalf(disp string, args ...any) *Error { return NewInternal(fmt.Sprintf(disp, args...)) } @@ -158,7 +158,7 @@ func WrapInternal(err error, disp string) *Error { } // WrapInternalf wraps an error and a display string with args into a localised internal error -func WrapInternalf(err error, disp string, args ...interface{}) *Error { +func WrapInternalf(err error, disp string, args ...any) *Error { return WrapInternal(err, fmt.Sprintf(disp, args...)) } |
