diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 76b62d4cb..958322d4d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - uses: golangci/golangci-lint-action@v3 with: - version: v1.55.2 + version: v1.56.2 go-mod-tidy: runs-on: ubuntu-20.04 diff --git a/.golangci.yml b/.golangci.yml index d2c93841a..33a993a42 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,7 @@ linters: - nilerr - prealloc - revive + - usestdlibvars - unconvert - tparallel - wastedassign diff --git a/Makefile b/Makefile index 7b38cb1f9..b3375b08f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BASE_IMAGE = golang:1.21-alpine3.18 -LINT_IMAGE = golangci/golangci-lint:v1.55.2 +LINT_IMAGE = golangci/golangci-lint:v1.56.2 .PHONY: $(shell ls) diff --git a/cmd/dialects-gen/main.go b/cmd/dialects-gen/main.go index d69f49c15..9c218d9b0 100644 --- a/cmd/dialects-gen/main.go +++ b/cmd/dialects-gen/main.go @@ -97,7 +97,7 @@ func shellCommand(cmdstr string) error { } func downloadJSON(addr string, data interface{}) error { - req, err := http.NewRequest("GET", addr, nil) + req, err := http.NewRequest(http.MethodGet, addr, nil) if err != nil { return err } diff --git a/endpoint_serial.go b/endpoint_serial.go index 5b8648ee3..bd5c1095e 100644 --- a/endpoint_serial.go +++ b/endpoint_serial.go @@ -41,7 +41,7 @@ func (conf EndpointSerial) init(_ *Node) (Endpoint, error) { t := &endpointSerial{ conf: conf, reconnector: reconnector.New( - func(ctx context.Context) (io.ReadWriteCloser, error) { + func(_ context.Context) (io.ReadWriteCloser, error) { return serialOpenFunc(conf.Device, conf.Baud) }, ), diff --git a/endpoint_serial_test.go b/endpoint_serial_test.go index fd0cdd45a..9a4fcbd47 100644 --- a/endpoint_serial_test.go +++ b/endpoint_serial_test.go @@ -16,7 +16,7 @@ func TestEndpointSerial(t *testing.T) { done := make(chan struct{}) n := 0 - serialOpenFunc = func(name string, baud int) (io.ReadWriteCloser, error) { + serialOpenFunc = func(_ string, _ int) (io.ReadWriteCloser, error) { remote, local := newDummyReadWriterPair() n++ @@ -133,7 +133,7 @@ func TestEndpointSerialReconnect(t *testing.T) { done := make(chan struct{}) count := 0 - serialOpenFunc = func(name string, baud int) (io.ReadWriteCloser, error) { + serialOpenFunc = func(_ string, _ int) (io.ReadWriteCloser, error) { remote, local := newDummyReadWriterPair() switch count { diff --git a/pkg/reconnector/reconnector_test.go b/pkg/reconnector/reconnector_test.go index 87eddbce6..4b9fbff58 100644 --- a/pkg/reconnector/reconnector_test.go +++ b/pkg/reconnector/reconnector_test.go @@ -34,7 +34,7 @@ func TestReconnector(t *testing.T) { var buf dummyRWC r := New( - func(ctx context.Context) (io.ReadWriteCloser, error) { + func(_ context.Context) (io.ReadWriteCloser, error) { return &buf, nil }, )