ci: add go vet to test stage (!99)
* Add `go vet` to the test stage of the Gitlab CI/CD pipeline * Fix issues raised by `go vet` https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/merge_requests/99
This commit is contained in:
parent
8d457da2b9
commit
b6cec83503
3 changed files with 13 additions and 1 deletions
|
@ -19,6 +19,13 @@ format:
|
||||||
script:
|
script:
|
||||||
- make check/fmt
|
- make check/fmt
|
||||||
|
|
||||||
|
vet:
|
||||||
|
extends: .go_template
|
||||||
|
stage: test
|
||||||
|
allow_failure: true
|
||||||
|
script:
|
||||||
|
- make vet
|
||||||
|
|
||||||
test:
|
test:
|
||||||
extends: .go_template
|
extends: .go_template
|
||||||
stage: test
|
stage: test
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -20,6 +20,11 @@ update:
|
||||||
test: download
|
test: download
|
||||||
go test ./... -v -race
|
go test ./... -v -race
|
||||||
|
|
||||||
|
# Look for "suspicious constructs" in source code
|
||||||
|
.PHONY: vet
|
||||||
|
vet: download
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
# Format code
|
# Format code
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt: download
|
fmt: download
|
||||||
|
|
|
@ -53,7 +53,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleGracefulShutdown() {
|
func handleGracefulShutdown() {
|
||||||
var signals = make(chan os.Signal)
|
var signals = make(chan os.Signal, 1)
|
||||||
|
|
||||||
signal.Notify(signals, syscall.SIGTERM)
|
signal.Notify(signals, syscall.SIGTERM)
|
||||||
signal.Notify(signals, syscall.SIGINT)
|
signal.Notify(signals, syscall.SIGINT)
|
||||||
|
|
Loading…
Reference in a new issue