diff options
Diffstat (limited to 'modules/util')
-rw-r--r-- | modules/util/time_str.go | 2 | ||||
-rw-r--r-- | modules/util/util_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/util/time_str.go b/modules/util/time_str.go index b56f4740af..0fccfe82cc 100644 --- a/modules/util/time_str.go +++ b/modules/util/time_str.go @@ -25,7 +25,7 @@ type timeStrGlobalVarsType struct { // In the future, it could be some configurable options to help users // to convert the working time to different units. -var timeStrGlobalVars = sync.OnceValue[*timeStrGlobalVarsType](func() *timeStrGlobalVarsType { +var timeStrGlobalVars = sync.OnceValue(func() *timeStrGlobalVarsType { v := &timeStrGlobalVarsType{} v.re = regexp.MustCompile(`(?i)(\d+)\s*([hms])`) v.units = []struct { diff --git a/modules/util/util_test.go b/modules/util/util_test.go index 5abce08b41..52b05acc5b 100644 --- a/modules/util/util_test.go +++ b/modules/util/util_test.go @@ -242,10 +242,10 @@ func TestReserveLineBreakForTextarea(t *testing.T) { } func TestOptionalArg(t *testing.T) { - foo := func(other any, optArg ...int) int { + foo := func(_ any, optArg ...int) int { return OptionalArg(optArg) } - bar := func(other any, optArg ...int) int { + bar := func(_ any, optArg ...int) int { return OptionalArg(optArg, 42) } assert.Equal(t, 0, foo(nil)) |