Skip to content
third_party.go - self contained GOPATH helper
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


third_party.go is a self contained single file that helps with bumping third party repos and managing the GOPATH.

Build Status


Setup a repo

curl > third_party.go
go run third_party.go setup
git add .
git commit -m "Initial commit"

Build your project

When none of the third_party.go subcommands are used it acts simply as a wrapper around go that sets up the environment variables to GOPATH. So, just use build and your package name.

go run third_party.go build -v

Bumping a package

third_party.go helps you bump and manage packages. This will put the goraft package into your third_party/src directory and tell you the git commit that it came from.

go run third_party.go bump c064081f635e519f162280f133faebc1a445106b

It's also possible to bump a package to a specific ref

go run third_party.go bump 3509cfa7b1 3509cfa7b12a39cde502b0d4afa1dd1023ce603c

Bumping all packages

This will walk all of the packages installed in third_party/src and run the bump subcommand on it if it is a valid go pkg.

go run third_party.go bump-all

Testing third_party.go

Becuase third_party.go has a +build ignore tag at the top you will need to use the test script to run the unit tests:


Cross compiling

go run will use the GOOS and GOARCH flags when trying to run third_party.go. This will most certainly cause a crash trying to run a third_party.go cross-compiled binary on your workstation.

As a workaround you can provide the -os and -arch flags to set GOOS and GOARCH to the next process.

You can’t perform that action at this time.