all: gofmt -w -r 'interface{} -> any' .

Updates #9687
This commit is contained in:
Bjørn Erik Pedersen
2022-03-17 22:03:27 +01:00
parent 423594e03a
commit b80853de90
342 changed files with 2118 additions and 2102 deletions

View File

@@ -32,8 +32,8 @@ func TestTimeLocation(t *testing.T) {
for i, test := range []struct {
name string
value string
location interface{}
expect interface{}
location any
expect any
}{
{"Empty location", "2020-10-20", "", "2020-10-20 00:00:00 +0000 UTC"},
{"New location", "2020-10-20", nil, "2020-10-20 00:00:00 -0400 AST"},
@@ -53,7 +53,7 @@ func TestTimeLocation(t *testing.T) {
{"Invalid time value", "invalid-value", "", false},
} {
t.Run(test.name, func(t *testing.T) {
var args []interface{}
var args []any
if test.location != nil {
args = append(args, test.location)
}
@@ -90,8 +90,8 @@ func TestFormat(t *testing.T) {
for i, test := range []struct {
layout string
value interface{}
expect interface{}
value any
expect any
}{
{"Monday, Jan 2, 2006", "2015-01-21", "Wednesday, Jan 21, 2015"},
{"Monday, Jan 2, 2006", time.Date(2015, time.January, 21, 0, 0, 0, 0, time.UTC), "Wednesday, Jan 21, 2015"},
@@ -146,9 +146,9 @@ func TestDuration(t *testing.T) {
ns := New(translators.GetTranslator("en"), time.UTC)
for i, test := range []struct {
unit interface{}
num interface{}
expect interface{}
unit any
num any
expect any
}{
{"nanosecond", 10, 10 * time.Nanosecond},
{"ns", 10, 10 * time.Nanosecond},