Makefile: update golangci-lint from v1.29.0 to v1.40.1

This commit is contained in:
Aliaksandr Valialkin 2021-05-20 18:27:10 +03:00
parent 9aa22cccf0
commit 69e365cd48
3 changed files with 6 additions and 2 deletions

View file

@ -154,7 +154,7 @@ golangci-lint: install-golangci-lint
golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m
install-golangci-lint: install-golangci-lint:
which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.29.0 which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.40.1
install-wwhrd: install-wwhrd:
which wwhrd || GO111MODULE=off go get github.com/frapposelli/wwhrd which wwhrd || GO111MODULE=off go get github.com/frapposelli/wwhrd

View file

@ -13,6 +13,7 @@ func TestTLSConfig(t *testing.T) {
} }
if tlsCfg == nil { if tlsCfg == nil {
t.Errorf("expected tlsConfig to be set, got nil") t.Errorf("expected tlsConfig to be set, got nil")
return
} }
if tlsCfg.ServerName != serverName { if tlsCfg.ServerName != serverName {
t.Errorf("unexpected ServerName, want %s, got %s", serverName, tlsCfg.ServerName) t.Errorf("unexpected ServerName, want %s, got %s", serverName, tlsCfg.ServerName)

View file

@ -153,7 +153,10 @@ func Stop(addr string) error {
delete(servers, addr) delete(servers, addr)
serversLock.Unlock() serversLock.Unlock()
if s == nil { if s == nil {
logger.Panicf("BUG: there is no http server at %q", addr) err := fmt.Errorf("BUG: there is no http server at %q", addr)
logger.Panicf("%s", err)
// The return is needed for golangci-lint: SA5011(related information): this check suggests that the pointer can be nil
return err
} }
deadline := time.Now().Add(*shutdownDelay).UnixNano() deadline := time.Now().Add(*shutdownDelay).UnixNano()