# The builder and linter for this repository
# Notice how we depend upon nothing twitch specific: just pulling the core golang docker image
FROM golang:1.14.4

# Do this first so this step is cached
RUN GOPROXY=direct GOPRIVATE='*' GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.27.0
# Go modules don't need to be in GOPATH.  Just build/test inside app
WORKDIR /app
# Add our code, build it, test it, etc
ADD . .
# Always use vendor mode
ENV GOFLAGS=-mod=vendor
# Lint our code
RUN golangci-lint run
# Run the unit tests with the race detector
RUN go test -race ./...
