machine:
  environment:
    IMPORT_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
    COPY_TARGET: echo $GOPATH | sed 's/:.*//'

dependencies:
  override:
    - mkdir -p "$COPY_TARGET/src/$IMPORT_PATH"
    - rsync -azC --delete ./ "$COPY_TARGET/src/$IMPORT_PATH/"

test:
  pre:
    - go vet ./...
  override:
    - go test ./... -race

machine:
  environment:
    IMPORT_PATH: "github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"

dependencies:
  override:
    - COPY_TARGET=$( echo $GOPATH | sed 's/:.*//' ) mkdir -p "$COPY_TARGET/src/$IMPORT_PATH"
    - COPY_TARGET=$( echo $GOPATH | sed 's/:.*//' ) rsync -azC --delete ./ "$COPY_TARGET/src/$IMPORT_PATH/"

test:
  pre:
    - go vet ./...
  override:
    - go test ./... -race

Move COPY_TARGET ENV declaration inline
Move COPY_TARGET ENV declaration inline

CircleCI apparently does not evaluate ENV declarations as previously
assumed. This moves the declarations inline with each command that
depends on the COPY_TARGET ENV in the hopes that CircleCI will blindly
evaluate the entire line.
