Commit 67b4f267 authored by Zachary Seguin's avatar Zachary Seguin

Lint code before running build

parent 74857fb8
Pipeline #105 failed
image: golang:1.9 image: golang:1.9
stages: stages:
- check
- build - build
- test - test
...@@ -10,6 +11,14 @@ before_script: ...@@ -10,6 +11,14 @@ before_script:
- ln -sv ${CI_PROJECT_DIR} /go/src/git.zacharyseguin.ca/${CI_PROJECT_PATH} - ln -sv ${CI_PROJECT_DIR} /go/src/git.zacharyseguin.ca/${CI_PROJECT_PATH}
- cd /go/src/git.zacharyseguin.ca/${CI_PROJECT_PATH} - cd /go/src/git.zacharyseguin.ca/${CI_PROJECT_PATH}
go lint:
stage: check
before_script:
- go get gopkg.in/alecthomas/gometalinter.v1
- gometalinter.v1 --install
script:
- gometalinter.v1 --exclude=vendor --disable-all --enable=golint ./...
go build: go build:
stage: build stage: build
script: script:
...@@ -25,4 +34,4 @@ go test: ...@@ -25,4 +34,4 @@ go test:
script: script:
- godep restore - godep restore
- godep go test -v -cover -race ./... - godep go test -v -cover -race ./...
coverage: '/^coverage: (\d+\.\d+)% of statements/' coverage: '/^coverage: (\d+\.\d+)% of statements/'gometalinter.v1 --exclude=vendor --disable-all --enable=golint ./...
\ No newline at end of file
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"strings" "strings"
) )
// SegmentType is the type of track segment.
type SegmentType int type SegmentType int
const ( const (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment