Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created October 6, 2017 11:27
Show Gist options
  • Save KushalP/a9690f6d903636d0962341542e1e35f7 to your computer and use it in GitHub Desktop.
Save KushalP/a9690f6d903636d0962341542e1e35f7 to your computer and use it in GitHub Desktop.
Example of how I like to use dep, make, and golang

Example of how you'd run the tests:

$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.8 \
    go get -u github.com/golang/dep/cmd/dep && make
BINARY := service-versions # This is whatever you want to name the binary
all: build
deps:
dep ensure
build: deps
go build -o $(BINARY)
test: deps
go test -v $$(go list ./... | grep -v vendor)
bench: deps
go test -test.bench=".*" -v $$(go list ./... | grep -v vendor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment