diff options
author | 2024-04-26 11:31:10 +0200 | |
---|---|---|
committer | 2024-04-26 11:31:10 +0200 | |
commit | fd8a724e77123d5035d4070581dab777b4533ebb (patch) | |
tree | 0d3d20ad5c7c2177d970ead12f5108d1d3666623 /vendor/github.com/go-openapi/strfmt/format.go | |
parent | [chore] Upgrade our Go version to 1.22 (#2862) (diff) | |
download | gotosocial-fd8a724e77123d5035d4070581dab777b4533ebb.tar.xz |
[chore] Bump go swagger (#2871)
* bump go swagger version
* bump swagger version
Diffstat (limited to 'vendor/github.com/go-openapi/strfmt/format.go')
-rw-r--r-- | vendor/github.com/go-openapi/strfmt/format.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go index ad3b3c355..888e107c3 100644 --- a/vendor/github.com/go-openapi/strfmt/format.go +++ b/vendor/github.com/go-openapi/strfmt/format.go @@ -16,6 +16,7 @@ package strfmt import ( "encoding" + stderrors "errors" "fmt" "reflect" "strings" @@ -94,7 +95,7 @@ func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry { } // MapStructureHookFunc is a decode hook function for mapstructure -func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { //nolint:gocyclo,cyclop +func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { return func(from reflect.Type, to reflect.Type, obj interface{}) (interface{}, error) { if from.Kind() != reflect.String { return obj, nil @@ -117,7 +118,7 @@ func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { // case "datetime": input := data if len(input) == 0 { - return nil, fmt.Errorf("empty string is an invalid datetime format") + return nil, stderrors.New("empty string is an invalid datetime format") } return ParseDateTime(input) case "duration": |