Skip to content

Commit d9a7748

Browse files
bump to go 1.23 (#31855)
1 parent 1620e3f commit d9a7748

File tree

27 files changed

+71
-58
lines changed

27 files changed

+71
-58
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "Gitea DevContainer",
3-
"image": "mcr.microsoft.com/devcontainers/go:1.22-bullseye",
3+
"image": "mcr.microsoft.com/devcontainers/go:1.23-bookworm",
44
"features": {
55
// installs nodejs into container
66
"ghcr.io/devcontainers/features/node:1": {
77
"version": "20"
88
},
9-
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {},
9+
"ghcr.io/devcontainers/features/git-lfs:1.2.2": {},
1010
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
1111
"ghcr.io/devcontainers/features/python:1": {
1212
"version": "3.12"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
2+
FROM docker.io/library/golang:1.23-alpine3.20 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
2+
FROM docker.io/library/golang:1.23-alpine3.20 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ SHASUM ?= shasum -a 256
2323
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
2424
COMMA := ,
2525

26-
XGO_VERSION := go-1.22.x
26+
XGO_VERSION := go-1.23.x
2727

2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
30-
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.6.0
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
30+
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.7.0
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]

assets/go-licenses.json

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/hook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,14 @@ Gitea or set your environment appropriately.`, "")
542542

543543
index := bytes.IndexByte(rs.Data, byte(0))
544544
if index >= len(rs.Data) {
545-
return fail(ctx, "Protocol: format error", "pkt-line: format error "+fmt.Sprint(rs.Data))
545+
return fail(ctx, "Protocol: format error", "pkt-line: format error %s", rs.Data)
546546
}
547547

548548
if index < 0 {
549549
if len(rs.Data) == 10 && rs.Data[9] == '\n' {
550550
index = 9
551551
} else {
552-
return fail(ctx, "Protocol: format error", "pkt-line: format error "+fmt.Sprint(rs.Data))
552+
return fail(ctx, "Protocol: format error", "pkt-line: format error %s", rs.Data)
553553
}
554554
}
555555

go.mod

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module code.gitea.io/gitea
22

3-
go 1.22
3+
go 1.23
44

55
require (
66
code.gitea.io/actions-proto-go v0.4.0
@@ -112,11 +112,11 @@ require (
112112
github.com/yuin/goldmark-meta v1.1.0
113113
golang.org/x/crypto v0.26.0
114114
golang.org/x/image v0.18.0
115-
golang.org/x/net v0.26.0
115+
golang.org/x/net v0.28.0
116116
golang.org/x/oauth2 v0.21.0
117117
golang.org/x/sys v0.23.0
118118
golang.org/x/text v0.17.0
119-
golang.org/x/tools v0.22.0
119+
golang.org/x/tools v0.24.0
120120
google.golang.org/grpc v1.62.1
121121
google.golang.org/protobuf v1.34.2
122122
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
@@ -249,18 +249,20 @@ require (
249249
github.com/modern-go/reflect2 v1.0.2 // indirect
250250
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
251251
github.com/mschoch/smat v0.2.0 // indirect
252+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
252253
github.com/nwaples/rardecode v1.1.3 // indirect
253254
github.com/oklog/ulid v1.3.1 // indirect
254255
github.com/olekukonko/tablewriter v0.0.5 // indirect
255256
github.com/onsi/ginkgo v1.16.5 // indirect
257+
github.com/onsi/gomega v1.33.1 // indirect
256258
github.com/paulmach/orb v0.11.1 // indirect
257-
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
259+
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
258260
github.com/pierrec/lz4/v4 v4.1.21 // indirect
259261
github.com/pjbgf/sha1cd v0.3.0 // indirect
260262
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
261-
github.com/prometheus/client_model v0.6.0 // indirect
262-
github.com/prometheus/common v0.50.0 // indirect
263-
github.com/prometheus/procfs v0.13.0 // indirect
263+
github.com/prometheus/client_model v0.6.1 // indirect
264+
github.com/prometheus/common v0.55.0 // indirect
265+
github.com/prometheus/procfs v0.15.1 // indirect
264266
github.com/rhysd/actionlint v1.7.1 // indirect
265267
github.com/rivo/uniseg v0.4.7 // indirect
266268
github.com/rogpeppe/go-internal v1.12.0 // indirect
@@ -300,7 +302,7 @@ require (
300302
go.uber.org/multierr v1.11.0 // indirect
301303
go.uber.org/zap v1.27.0 // indirect
302304
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect
303-
golang.org/x/mod v0.18.0 // indirect
305+
golang.org/x/mod v0.20.0 // indirect
304306
golang.org/x/sync v0.8.0 // indirect
305307
golang.org/x/time v0.5.0 // indirect
306308
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect

go.sum

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,8 @@ github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
611611
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
612612
github.com/msteinert/pam v1.2.0 h1:mYfjlvN2KYs2Pb9G6nb/1f/nPfAttT/Jee5Sq9r3bGE=
613613
github.com/msteinert/pam v1.2.0/go.mod h1:d2n0DCUK8rGecChV3JzvmsDjOY4R7AYbsNxAT+ftQl0=
614+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
615+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
614616
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
615617
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
616618
github.com/niklasfasching/go-org v1.7.0 h1:vyMdcMWWTe/XmANk19F4k8XGBYg0GQ/gJGMimOjGMek=
@@ -635,8 +637,8 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042
635637
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
636638
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
637639
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
638-
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
639-
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
640+
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
641+
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
640642
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
641643
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
642644
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
@@ -646,8 +648,8 @@ github.com/paulmach/orb v0.11.1 h1:3koVegMC4X/WeiXYz9iswopaTwMem53NzTJuTF20JzU=
646648
github.com/paulmach/orb v0.11.1/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
647649
github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
648650
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
649-
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
650-
github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
651+
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
652+
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
651653
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
652654
github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
653655
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
@@ -666,12 +668,12 @@ github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg=
666668
github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
667669
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
668670
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
669-
github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
670-
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
671-
github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ=
672-
github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ=
673-
github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o=
674-
github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g=
671+
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
672+
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
673+
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
674+
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
675+
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
676+
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
675677
github.com/quasoft/websspi v1.1.2 h1:/mA4w0LxWlE3novvsoEL6BBA1WnjJATbjkh1kFrTidw=
676678
github.com/quasoft/websspi v1.1.2/go.mod h1:HmVdl939dQ0WIXZhyik+ARdI03M6bQzaSEKcgpFmewk=
677679
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
@@ -752,6 +754,7 @@ github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7
752754
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
753755
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
754756
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
757+
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
755758
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
756759
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
757760
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@@ -880,8 +883,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
880883
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
881884
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
882885
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
883-
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
884-
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
886+
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
887+
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
885888
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
886889
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
887890
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -899,8 +902,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
899902
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
900903
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
901904
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
902-
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
903-
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
905+
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
906+
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
904907
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
905908
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
906909
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -985,8 +988,8 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f
985988
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
986989
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
987990
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
988-
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
989-
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
991+
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
992+
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
990993
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
991994
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
992995
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

models/asymkey/gpg_key_common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func readArmoredSign(r io.Reader) (body io.Reader, err error) {
114114
return nil, err
115115
}
116116
if block.Type != openpgp.SignatureType {
117-
return nil, fmt.Errorf("expected '" + openpgp.SignatureType + "', got: " + block.Type)
117+
return nil, fmt.Errorf("expected '%s', got: %s", openpgp.SignatureType, block.Type)
118118
}
119119
return block.Body, nil
120120
}
@@ -139,7 +139,7 @@ func tryGetKeyIDFromSignature(sig *packet.Signature) string {
139139
if sig.IssuerKeyId != nil && (*sig.IssuerKeyId) != 0 {
140140
return fmt.Sprintf("%016X", *sig.IssuerKeyId)
141141
}
142-
if sig.IssuerFingerprint != nil && len(sig.IssuerFingerprint) > 0 {
142+
if len(sig.IssuerFingerprint) > 0 {
143143
return fmt.Sprintf("%016X", sig.IssuerFingerprint[12:20])
144144
}
145145
return ""

models/db/sql_postgres_with_schema.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (d *postgresSchemaDriver) Open(name string) (driver.Conn, error) {
3939

4040
// golangci lint is incorrect here - there is no benefit to using driver.ExecerContext here
4141
// and in any case pq does not implement it
42-
if execer, ok := conn.(driver.Execer); ok { //nolint
42+
if execer, ok := conn.(driver.Execer); ok { //nolint:staticcheck
4343
_, err := execer.Exec(`SELECT set_config(
4444
'search_path',
4545
$1 || ',' || current_setting('search_path'),
@@ -64,7 +64,7 @@ func (d *postgresSchemaDriver) Open(name string) (driver.Conn, error) {
6464
// driver.String.ConvertValue will never return err for string
6565

6666
// golangci lint is incorrect here - there is no benefit to using stmt.ExecWithContext here
67-
_, err = stmt.Exec([]driver.Value{schemaValue}) //nolint
67+
_, err = stmt.Exec([]driver.Value{schemaValue}) //nolint:staticcheck
6868
if err != nil {
6969
_ = conn.Close()
7070
return nil, err

models/migrations/v1_16/v189.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func UnwrapLDAPSourceCfg(x *xorm.Engine) error {
8383
if err != nil {
8484
return fmt.Errorf("failed to unmarshal %s: %w", source.Cfg, err)
8585
}
86-
if wrapped.Source != nil && len(wrapped.Source) > 0 {
86+
if len(wrapped.Source) > 0 {
8787
bs, err := json.Marshal(wrapped.Source)
8888
if err != nil {
8989
return err

models/repo/repo_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ func GetUserRepositories(ctx context.Context, opts *SearchRepoOptions) (Reposito
749749
cond = cond.And(builder.Eq{"is_private": false})
750750
}
751751

752-
if opts.LowerNames != nil && len(opts.LowerNames) > 0 {
752+
if len(opts.LowerNames) > 0 {
753753
cond = cond.And(builder.In("lower_name", opts.LowerNames))
754754
}
755755

modules/cache/context.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ func WithCacheContext(ctx context.Context) context.Context {
109109
return ctx
110110
}
111111
}
112-
return context.WithValue(ctx, cacheContextKey, &cacheContext{
112+
// FIXME: review the use of this nolint directive
113+
return context.WithValue(ctx, cacheContextKey, &cacheContext{ //nolint:staticcheck
113114
data: make(map[any]map[any]any),
114115
created: timeNow(),
115116
})

modules/git/log_name_status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type LogNameStatusCommitData struct {
114114
// Next returns the next LogStatusCommitData
115115
func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int, changed []bool, maxpathlen int) (*LogNameStatusCommitData, error) {
116116
var err error
117-
if g.next == nil || len(g.next) == 0 {
117+
if len(g.next) == 0 {
118118
g.buffull = false
119119
g.next, err = g.rd.ReadSlice('\x00')
120120
if err != nil {

modules/issue/template/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ func (f *valuedField) Render() string {
401401
}
402402

403403
func (f *valuedField) Value() string {
404-
return strings.TrimSpace(f.Get(fmt.Sprintf("form-field-" + f.ID)))
404+
return strings.TrimSpace(f.Get(fmt.Sprintf("form-field-%s", f.ID)))
405405
}
406406

407407
func (f *valuedField) Options() []*valuedOption {

modules/queue/base_channel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (q *baseChannel) RemoveAll(ctx context.Context) error {
120120
q.mu.Lock()
121121
defer q.mu.Unlock()
122122

123-
for q.c != nil && len(q.c) > 0 {
123+
for len(q.c) > 0 {
124124
<-q.c
125125
}
126126

modules/storage/azureblob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func convertAzureBlobErr(err error) error {
114114
if !errors.As(err, &respErr) {
115115
return err
116116
}
117-
return fmt.Errorf(respErr.ErrorCode)
117+
return fmt.Errorf("%s", respErr.ErrorCode)
118118
}
119119

120120
// NewAzureBlobStorage returns a azure blob storage

routers/api/v1/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ func EditPullRequest(ctx *context.APIContext) {
766766
// update allow edits
767767
if form.AllowMaintainerEdit != nil {
768768
if err := pull_service.SetAllowEdits(ctx, ctx.Doer, pr, *form.AllowMaintainerEdit); err != nil {
769-
if errors.Is(pull_service.ErrUserHasNoPermissionForAction, err) {
769+
if errors.Is(err, pull_service.ErrUserHasNoPermissionForAction) {
770770
ctx.Error(http.StatusForbidden, "SetAllowEdits", fmt.Sprintf("SetAllowEdits: %s", err))
771771
return
772772
}

routers/web/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ func SetAllowEdits(ctx *context.Context) {
16251625
}
16261626

16271627
if err := pull_service.SetAllowEdits(ctx, ctx.Doer, pr, form.AllowMaintainerEdit); err != nil {
1628-
if errors.Is(pull_service.ErrUserHasNoPermissionForAction, err) {
1628+
if errors.Is(err, pull_service.ErrUserHasNoPermissionForAction) {
16291629
ctx.Error(http.StatusForbidden)
16301630
return
16311631
}

routers/web/repo/view.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"bytes"
99
gocontext "context"
1010
"encoding/base64"
11+
"errors"
1112
"fmt"
1213
"html/template"
1314
"image"
@@ -739,7 +740,7 @@ func checkHomeCodeViewable(ctx *context.Context) {
739740
}
740741
}
741742

742-
ctx.NotFound("Home", fmt.Errorf(ctx.Locale.TrString("units.error.no_unit_allowed_repo")))
743+
ctx.NotFound("Home", errors.New(ctx.Locale.TrString("units.error.no_unit_allowed_repo")))
743744
}
744745

745746
func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {

routers/web/user/home.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ func UsernameSubRoute(ctx *context.Context) {
730730

731731
// check view permissions
732732
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
733-
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
733+
ctx.NotFound("user", fmt.Errorf("%s", ctx.ContextUser.Name))
734734
return false
735735
}
736736
return true

routers/web/user/profile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func OwnerProfile(ctx *context.Context) {
5454
func userProfile(ctx *context.Context) {
5555
// check view permissions
5656
if !user_model.IsUserVisibleToViewer(ctx, ctx.ContextUser, ctx.Doer) {
57-
ctx.NotFound("user", fmt.Errorf(ctx.ContextUser.Name))
57+
ctx.NotFound("user", fmt.Errorf("%s", ctx.ContextUser.Name))
5858
return
5959
}
6060

services/actions/notifier_helper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ func withMethod(ctx context.Context, method string) context.Context {
4343
return ctx
4444
}
4545
}
46-
return context.WithValue(ctx, methodCtxKey, method)
46+
// FIXME: review the use of this nolint directive
47+
return context.WithValue(ctx, methodCtxKey, method) //nolint:staticcheck
4748
}
4849

4950
// getMethod gets the notification method that this context currently executes.

services/automerge/automerge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func handlePullRequestAutoMerge(pullID int64, sha string) {
288288
}
289289

290290
if err := pull_service.CheckPullMergeable(ctx, doer, &perm, pr, pull_service.MergeCheckTypeGeneral, false); err != nil {
291-
if errors.Is(pull_service.ErrUserNotAllowedToMerge, err) {
291+
if errors.Is(err, pull_service.ErrUserNotAllowedToMerge) {
292292
log.Info("%-v was scheduled to automerge by an unauthorized user", pr)
293293
return
294294
}

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ parts:
4444
source: .
4545
stage-packages: [ git, sqlite3, openssh-client ]
4646
build-packages: [ git, libpam0g-dev, libsqlite3-dev, build-essential]
47-
build-snaps: [ go/1.22/stable, node/20/stable ]
47+
build-snaps: [ go/1.23/stable, node/20/stable ]
4848
build-environment:
4949
- LDFLAGS: ""
5050
override-pull: |

0 commit comments

Comments
 (0)