chore(ci): upgrade go to v1.23 and linter

This commit is contained in:
Michel Loiseleur
2025-01-21 10:02:04 +01:00
committed by GitHub
parent dec1ed84e3
commit 4c339e1ec6
6 changed files with 7 additions and 25 deletions

View File

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.58.0
GOLANGCI_LINT_VERSION: v1.63.4
CGO_ENABLED: 0
steps:

View File

@ -52,30 +52,18 @@ linters-settings:
linters:
enable-all: true
disable:
- deadcode # deprecated
- exhaustivestruct # deprecated
- golint # deprecated
- ifshort # deprecated
- interfacer # deprecated
- maligned # deprecated
- nosnakecase # deprecated
- scopelint # deprecated
- scopelint # deprecated
- structcheck # deprecated
- varcheck # deprecated
- execinquery # not relevant (SQL)
- rowserrcheck # not relevant (SQL)
- sqlclosecheck # not relevant (SQL)
- cyclop # duplicate of gocyclo
- dupl
- exhaustive
- exhaustruct
- exportloopref
- forbidigo
- gochecknoglobals
- gochecknoinits
- err113
- mnd
- gomnd
- gosec
- lll
- nilnil

2
app.go
View File

@ -159,7 +159,7 @@ func echoHandler(w http.ResponseWriter, r *http.Request) {
func printBinary(s []byte) {
fmt.Printf("Received b:")
for n := 0; n < len(s); n++ {
for n := range s {
fmt.Printf("%d,", s[n])
}
fmt.Printf("\n")

View File

@ -19,7 +19,6 @@ func Test_contentReader_Read(t *testing.T) {
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
@ -56,7 +55,6 @@ func Test_contentReader_ReadSeek(t *testing.T) {
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

6
go.mod
View File

@ -1,7 +1,5 @@
module github.com/traefik/whoami
go 1.21
go 1.23
require github.com/gorilla/websocket v1.5.1
require golang.org/x/net v0.25.0 // indirect
require github.com/gorilla/websocket v1.5.3

6
go.sum
View File

@ -1,4 +1,2 @@
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=