Add `go` and `go-env` goals.

Review Request #3060 - Created Oct. 30, 2015 and submitted

John Sirois
2476, 2477
kwlzn, mateor, molsen, stuhood
These goals support running arbitrary go commands and arbitrary
third-party commands that respect the $GOROOT and $GOPATH.

In particular, 2 usecases are immediately enabled:
1. Certain enhanced Go editor environments now work with pants Go source
   trees including their 3rdparty deps, two of which this change was
   tested with: The GoSublime plugin for the Sublime Text editor and the
   go-vim plugin for the vim editor.
2. Certain go tooling without direct pants support can be used.  In
   particular `./pants go [targets] -- vet` now runs `go vet` for the
   given targets providing linting for common non-compile-time errors.

Tests are added for these tasks.

 contrib/go/src/python/pants/contrib/go/                |  3 ++
 contrib/go/src/python/pants/contrib/go/tasks/BUILD                | 13 +++++++
 contrib/go/src/python/pants/contrib/go/tasks/             | 85 +++++++++++++++++++++++++++++++++++++++++++++
 contrib/go/tests/python/pants_test/contrib/go/tasks/BUILD         | 12 +++++++
 contrib/go/tests/python/pants_test/contrib/go/tasks/ | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 207 insertions(+)

Manually tested with go-vim and sublime via:

./pants go-env contrib/go/examples:: -- subl
./pants go-env contrib/go/examples:: -- vim

In both cases, the plugins could both browse to 3rdparty code, stdlib code
and symbol completion for these worked as well. In the case of the stdlib
code, browsing was against the ~/.cache/pants bootstrapped Go
distribution as would be hoped.

Additionally successfully used the following to vet examples:

$ ./pants go contrib/go/examples/:: -- vet
INFO] Detected git repository at /home/jsirois/dev/3rdparty/jsirois-pants4 on branch jsirois/go/go
.pants.d/go/go/ possible misuse of unsafe.Pointer
exit status 1
.pants.d/go/go/ arg len(ancestors) for printf verb %s of wrong type: int
exit status 1
.pants.d/go/go/ go/printer.CommentedNode composite literal uses unkeyed fields
.pants.d/go/go/ go/ast.ExprStmt composite literal uses unkeyed fields
.pants.d/go/go/ go/ast.Ellipsis composite literal uses unkeyed fields
.pants.d/go/go/ go/ast.BlockStmt composite literal uses unkeyed fields
exit status 1

Just running against contrib/go/examples/src:: produced no errors.

CI went green here:

John Sirois
Vinny Fuentes
Jonathan Simms
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)