diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-17 22:03:27 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-03-17 22:03:27 +0100 |
commit | b80853de90b10171155b8f3fde47d64ec7bfa0dd (patch) | |
tree | 435d3dbf7a495a0c6ce64c9769e037179aa0d27b /tpl/inflect | |
parent | 423594e03a906ef4150f433666ff588b022c3c92 (diff) |
all: gofmt -w -r 'interface{} -> any' .
Updates #9687
Diffstat (limited to 'tpl/inflect')
-rw-r--r-- | tpl/inflect/inflect.go | 6 | ||||
-rw-r--r-- | tpl/inflect/inflect_test.go | 6 | ||||
-rw-r--r-- | tpl/inflect/init.go | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tpl/inflect/inflect.go b/tpl/inflect/inflect.go index 787e2c53b..1f887cecd 100644 --- a/tpl/inflect/inflect.go +++ b/tpl/inflect/inflect.go @@ -38,7 +38,7 @@ type Namespace struct{} // Example: "my-first-post" -> "My first post" // Example: "103" -> "103rd" // Example: 52 -> "52nd" -func (ns *Namespace) Humanize(in interface{}) (string, error) { +func (ns *Namespace) Humanize(in any) (string, error) { word, err := cast.ToStringE(in) if err != nil { return "", err @@ -59,7 +59,7 @@ func (ns *Namespace) Humanize(in interface{}) (string, error) { } // Pluralize returns the plural form of a single word. -func (ns *Namespace) Pluralize(in interface{}) (string, error) { +func (ns *Namespace) Pluralize(in any) (string, error) { word, err := cast.ToStringE(in) if err != nil { return "", err @@ -69,7 +69,7 @@ func (ns *Namespace) Pluralize(in interface{}) (string, error) { } // Singularize returns the singular form of a single word. -func (ns *Namespace) Singularize(in interface{}) (string, error) { +func (ns *Namespace) Singularize(in any) (string, error) { word, err := cast.ToStringE(in) if err != nil { return "", err diff --git a/tpl/inflect/inflect_test.go b/tpl/inflect/inflect_test.go index 7e2839a8a..083e7da4e 100644 --- a/tpl/inflect/inflect_test.go +++ b/tpl/inflect/inflect_test.go @@ -13,9 +13,9 @@ func TestInflect(t *testing.T) { ns := New() for _, test := range []struct { - fn func(i interface{}) (string, error) - in interface{} - expect interface{} + fn func(i any) (string, error) + in any + expect any }{ {ns.Humanize, "MyCamel", "My camel"}, {ns.Humanize, "óbito", "Óbito"}, diff --git a/tpl/inflect/init.go b/tpl/inflect/init.go index 548827465..a2d28f6bf 100644 --- a/tpl/inflect/init.go +++ b/tpl/inflect/init.go @@ -26,7 +26,7 @@ func init() { ns := &internal.TemplateFuncsNamespace{ Name: name, - Context: func(args ...interface{}) (interface{}, error) { return ctx, nil }, + Context: func(args ...any) (any, error) { return ctx, nil }, } ns.AddMethodMapping(ctx.Humanize, |