Skip to content

Instantly share code, notes, and snippets.

@ernado
Last active September 15, 2018 10:40
Show Gist options
  • Select an option

  • Save ernado/2df932afab31599e0b07c49ef7988650 to your computer and use it in GitHub Desktop.

Select an option

Save ernado/2df932afab31599e0b07c49ef7988650 to your computer and use it in GitHub Desktop.
Makefile for gb golang project including gometalinter and goling
export GOPATH := $(shell gb env | grep GB_SRC_PATH | sed -r "s/\/(\w+)\/src/\/\1/g" | sed -r "s:GB_SRC_PATH=|\"::g")
all: format check build test info
test:
gb test
format:
go fmt .
goimports -w .
build:
gb build
check: format
gometalinter --deadline 60s --enable lll --enable goimports --disable errcheck --disable gotype --disable golint --disable aligncheck
check-fast:
gometalinter --enable goimports --enable lll --disable errcheck --disable gotype --disable golint --fast
lint:
golint
benhmark: format
gb test -bench Benchmark.+ -run -Benchmark.+ -v
info: format
depscheck -totalonly -tests .
golocc
std-info: format
depscheck -stdlib -v .
install:
go get github.com/warmans/golocc
go get github.com/divan/depscheck
go get github.com/alecthomas/gometalinter
gometalinter --install --update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment