Skip to content

Commit 987d014

Browse files
authored
Update go tool dependencies (#32916) (#33355)
Clean cherry-pick of #32916. Update all go tool dependencies to latest version.
1 parent e08eed9 commit 987d014

File tree

8 files changed

+11
-14
lines changed

8 files changed

+11
-14
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ COMMA := ,
2626
XGO_VERSION := go-1.23.x
2727

2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
29-
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0
29+
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@v3.0.3
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected]
32-
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected].11
33-
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.5.1
32+
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected].12
33+
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/misspell@v0.6.0
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
3737
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
3838
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1
39-
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.15.3
39+
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.17.0
4040

4141
DOCKER_IMAGE ?= gitea/gitea
4242
DOCKER_TAG ?= latest

modules/markup/common/linkify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type GlobalVarsType struct {
2424
LinkRegex *regexp.Regexp // fast matching a URL link, no any extra validation.
2525
}
2626

27-
var GlobalVars = sync.OnceValue[*GlobalVarsType](func() *GlobalVarsType {
27+
var GlobalVars = sync.OnceValue(func() *GlobalVarsType {
2828
v := &GlobalVarsType{}
2929
v.wwwURLRegxp = regexp.MustCompile(`^www\.[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}((?:/|[#?])[-a-zA-Z0-9@:%_\+.~#!?&//=\(\);,'">\^{}\[\]` + "`" + `]*)?`)
3030
v.LinkRegex, _ = xurls.StrictMatchingScheme("https?://")

modules/markup/html.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type globalVarsType struct {
4242
nulCleaner *strings.Replacer
4343
}
4444

45-
var globalVars = sync.OnceValue[*globalVarsType](func() *globalVarsType {
45+
var globalVars = sync.OnceValue(func() *globalVarsType {
4646
v := &globalVarsType{}
4747
// NOTE: All below regex matching do not perform any extra validation.
4848
// Thus a link is produced even if the linked entity does not exist.

modules/markup/internal/renderinternal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"golang.org/x/net/html"
1818
)
1919

20-
var reAttrClass = sync.OnceValue[*regexp.Regexp](func() *regexp.Regexp {
20+
var reAttrClass = sync.OnceValue(func() *regexp.Regexp {
2121
// TODO: it isn't a problem at the moment because our HTML contents are always well constructed
2222
return regexp.MustCompile(`(<[^>]+)\s+class="([^"]+)"([^>]*>)`)
2323
})

modules/markup/markdown/goldmark.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
112112
}
113113

114114
// it is copied from old code, which is quite doubtful whether it is correct
115-
var reValidIconName = sync.OnceValue[*regexp.Regexp](func() *regexp.Regexp {
115+
var reValidIconName = sync.OnceValue(func() *regexp.Regexp {
116116
return regexp.MustCompile(`^[-\w]+$`) // old: regexp.MustCompile("^[a-z ]+$")
117117
})
118118

modules/util/time_str.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type timeStrGlobalVarsType struct {
2525
// In the future, it could be some configurable options to help users
2626
// to convert the working time to different units.
2727

28-
var timeStrGlobalVars = sync.OnceValue[*timeStrGlobalVarsType](func() *timeStrGlobalVarsType {
28+
var timeStrGlobalVars = sync.OnceValue(func() *timeStrGlobalVarsType {
2929
v := &timeStrGlobalVarsType{}
3030
v.re = regexp.MustCompile(`(?i)(\d+)\s*([hms])`)
3131
v.units = []struct {

modules/util/util_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ func TestReserveLineBreakForTextarea(t *testing.T) {
242242
}
243243

244244
func TestOptionalArg(t *testing.T) {
245-
foo := func(other any, optArg ...int) int {
245+
foo := func(_ any, optArg ...int) int {
246246
return OptionalArg(optArg)
247247
}
248-
bar := func(other any, optArg ...int) int {
248+
bar := func(_ any, optArg ...int) int {
249249
return OptionalArg(optArg, 42)
250250
}
251251
assert.Equal(t, 0, foo(nil))

routers/web/repo/pull.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,6 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
701701

702702
if ctx.Written() {
703703
return
704-
} else if prInfo == nil {
705-
ctx.NotFound("ViewPullFiles", nil)
706-
return
707704
}
708705

709706
headCommitID, err := gitRepo.GetRefCommitID(pull.GetGitRefName())

0 commit comments

Comments
 (0)