machine:
  services:
    - docker

checkout:
  post:
    - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]]
    - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/

dependencies:
  pre:
    - make deps
  override:
    - make

test:
  override:
    - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls
    - |
      formatted="$(go fmt ./...)" && \
      ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed")  ) )


machine:
  services:
    - docker

checkout:
  post:
    - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]]
    - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}
    - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}

dependencies:
  pre:
    - make deps
    - go generate
    - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/
  override:
    - make

test:
  override:
    - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls
    - |
      formatted="$(go fmt ./...)" && \
      ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed")  ) )


Fix up go generate stuff
Fix up go generate stuff
