aboutsummaryrefslogtreecommitdiffstats
path: root/modules/util
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-12-19 19:17:55 +0100
committerGitHub <noreply@github.com>2024-12-19 19:17:55 +0100
commit626b27bea56a81055a796d452a9ef4fd6e0f4fca (patch)
treee09993b72ccdb2c919bcc5cba68732460bc5cf28 /modules/util
parent581e52b3e78df0da7b31cea107c675dace5e871c (diff)
downloadgitea-626b27bea56a81055a796d452a9ef4fd6e0f4fca.tar.gz
gitea-626b27bea56a81055a796d452a9ef4fd6e0f4fca.zip
Update go tool dependencies (#32916)
Update all go tool dependencies to latest version. WIP because I think there are new gopls errors, would like to confirm them on CI first. Here is from a local run: ``` modules/markup/markdown/goldmark.go:115:37-53: unnecessary type arguments modules/markup/html.go:45:32-49: unnecessary type arguments modules/markup/internal/renderinternal.go:20:33-49: unnecessary type arguments modules/markup/common/linkify.go:27:32-49: unnecessary type arguments modules/util/time_str.go:28:39-63: unnecessary type arguments routers/web/repo/pull.go:704:19: impossible condition: non-nil == nil modules/util/util_test.go:248:14-23: unused parameter: other ``` ~~Backport because the `gxz` update might have security benefits.~~
Diffstat (limited to 'modules/util')
-rw-r--r--modules/util/time_str.go2
-rw-r--r--modules/util/util_test.go4
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))