From 173cf374f953deece8ebc79e726fa0ed8a6bb02f Mon Sep 17 00:00:00 2001 From: Erin Call Date: Mon, 16 Dec 2019 15:44:46 -0800 Subject: [PATCH 1/2] Run linting on an image with golint preinstalled Running `go get` adds a line to `go.mod` every time, so using a preinstalled golint avoids churn. --- .drone.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index b37eba8..a7310e7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,8 +9,10 @@ steps: commands: - go test ./cmd/... ./internal/... - go vet ./cmd/... ./internal/... - - go get -u golang.org/x/lint/golint - - golint ./cmd/... ./internal/... + - name: lint + image: cytopia/golint + commands: + - golint -set_exit_status ./cmd/... ./internal/... - name: build image: golang:1.13 commands: From 9797f5c8a2b8a508924005abd3e1cdb6282c820e Mon Sep 17 00:00:00 2001 From: Erin Call Date: Mon, 16 Dec 2019 15:46:37 -0800 Subject: [PATCH 2/2] Non-0 exit status on error --- cmd/drone-helm/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/drone-helm/main.go b/cmd/drone-helm/main.go index 3fbf3a4..61673b2 100644 --- a/cmd/drone-helm/main.go +++ b/cmd/drone-helm/main.go @@ -19,8 +19,8 @@ func main() { // Make the plan plan, err := helm.NewPlan(c) if err != nil { - fmt.Fprintf(os.Stderr, err.Error()) - return + fmt.Fprintf(os.Stderr, "%w\n", err) + os.Exit(1) } // Execute the plan