machine:
  environment:
    PATH: "/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:${PATH}"
    GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace"
    VERSION: "2.0.1"
    CGO_ENABLED: "0"

dependencies:
  override:
    - mkdir -p ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME} ${HOME}/output
    - ln -s ${HOME}/${CIRCLE_PROJECT_REPONAME} ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - go get github.com/mitchellh/gox
    - go get github.com/tcnksm/ghr
    - >
      gox -output="${HOME}/output/srcds_exporter_{{.OS}}_{{.Arch}}" -verbose -ldflags " \
        -X {{repoPath}}/version.Version=${VERSION} \
        -X {{repoPath}}/version.Revision=${CIRCLE_SHA1} \
        -X {{repoPath}}/version.Branch=${CIRCLE_BRANCH} \
        -X {{repoPath}}/version.BuildUser=$(whoami)@$(hostname) \
        -X {{repoPath}}/version.BuildDate=$(date)" \
        github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - ghr -draft -replace -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH}-build "${HOME}/output"

test:
  override:
    - govendor test -v -race ./...

machine:
  environment:
    PATH: "/usr/local/go/bin:/usr/local/go_workspace/bin:~/.go_workspace/bin:${PATH}"
    GOPATH: "${HOME}/.go_workspace:/usr/local/go_workspace"
    VERSION: "2.0.1"

dependencies:
  override:
    - mkdir -p ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME} ${HOME}/output
    - ln -s ${HOME}/${CIRCLE_PROJECT_REPONAME} ${HOME}/.go_workspace/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - go get github.com/mitchellh/gox
    - go get github.com/tcnksm/ghr
    - >
      CGO_ENABLED=0 gox -output="${HOME}/output/srcds_exporter_{{.OS}}_{{.Arch}}" -verbose -ldflags " \
        -X {{repoPath}}/version.Version=${VERSION} \
        -X {{repoPath}}/version.Revision=${CIRCLE_SHA1} \
        -X {{repoPath}}/version.Branch=${CIRCLE_BRANCH} \
        -X {{repoPath}}/version.BuildUser=$(whoami)@$(hostname) \
        -X {{repoPath}}/version.BuildDate=$(date)" \
        github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - ghr -draft -replace -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH}-build "${HOME}/output"

test:
  override:
    - govendor test -v -race ./...

Move the CGO_ENABLED to the gox build command
Move the CGO_ENABLED to the gox build command
