From e070fc402a4808cacc8b753ddc338a8c522531ed Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Mon, 2 Aug 2021 23:14:16 +0200 Subject: [PATCH] Added go vet, staticheck and lint to .drone.yml --- .drone.yml | 31 ++++++++++++++++++++++++++++--- pkg/server/server.go | 3 ++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 92f9976..47fff11 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,32 @@ type: docker name: default steps: -- name: test - image: golang +- name: static_check + image: golang:1.16 commands: - - ls -lah \ No newline at end of file + - go get honnef.co/go/tools/cmd/staticcheck + - staticcheck ./pkg/... + volumes: + - name: gopath + path: /go + +- name: lint + image: golang:1.16 + commands: + - go get golang.org/x/lint/golint + - golint -set_exit_status ./pkg/... + volumes: + - name: gopath + path: /go + +- name: vet + image: golang:1.16 + commands: + - go vet ./pkg/... + volumes: + - name: gopath + path: /go + +volumes: +- name: gopath + temp: {} \ No newline at end of file diff --git a/pkg/server/server.go b/pkg/server/server.go index af33c57..8687249 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -15,6 +15,7 @@ import ( "log" "os" "os/signal" + "syscall" "time" "vegvisir/pkg/cache" "vegvisir/pkg/config" @@ -61,7 +62,7 @@ func (s *Server) Run() { // Wait for an interrupt interrupt := make(chan os.Signal, 1) - signal.Notify(interrupt, os.Interrupt, os.Kill) + signal.Notify(interrupt, os.Interrupt, syscall.SIGTERM) <-interrupt log.Println("SIGKILL or SIGINT caught, shutting down...")