mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
@@ -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},
|
||||
|
Reference in New Issue
Block a user