diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 668d3fb..a7e3c55 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,13 @@ format: script: - make check/fmt +vet: + extends: .go_template + stage: test + allow_failure: true + script: + - make vet + test: extends: .go_template stage: test diff --git a/Makefile b/Makefile index e1854b8..4421341 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,11 @@ update: test: download go test ./... -v -race +# Look for "suspicious constructs" in source code +.PHONY: vet +vet: download + go vet ./... + # Format code .PHONY: fmt fmt: download diff --git a/exporter.go b/exporter.go index 6e7ae25..5dc6e0d 100644 --- a/exporter.go +++ b/exporter.go @@ -53,7 +53,7 @@ func main() { } func handleGracefulShutdown() { - var signals = make(chan os.Signal) + var signals = make(chan os.Signal, 1) signal.Notify(signals, syscall.SIGTERM) signal.Notify(signals, syscall.SIGINT)