diff --git a/Makefile b/Makefile index c343fce3a..7758fd720 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,7 @@ golangci-lint: install-golangci-lint golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m 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: which wwhrd || GO111MODULE=off go get github.com/frapposelli/wwhrd diff --git a/app/vmalert/utils/tls_test.go b/app/vmalert/utils/tls_test.go index 139a85f11..85888ee3a 100644 --- a/app/vmalert/utils/tls_test.go +++ b/app/vmalert/utils/tls_test.go @@ -13,6 +13,7 @@ func TestTLSConfig(t *testing.T) { } if tlsCfg == nil { t.Errorf("expected tlsConfig to be set, got nil") + return } if tlsCfg.ServerName != serverName { t.Errorf("unexpected ServerName, want %s, got %s", serverName, tlsCfg.ServerName) diff --git a/lib/httpserver/httpserver.go b/lib/httpserver/httpserver.go index f81bfe0c7..792eaef2e 100644 --- a/lib/httpserver/httpserver.go +++ b/lib/httpserver/httpserver.go @@ -153,7 +153,10 @@ func Stop(addr string) error { delete(servers, addr) serversLock.Unlock() 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()