bin: Files

Command gobin

Command gobin Go commands by reading their import paths, go-getting their repositories and building new executables.

Command gobin can search for and list Go executables, create a $GOPATH workspace out of a binary. It can also update an executable which does not have its sources fetched in current $GOPATH.


Command gobin can guess an origin of the sources used to build Go executables it finds on a system. It can be used to create precise mirror of the sources for system Go executables, without any unneeded packages.

~ $ gobin -s /tmp/gopath godoc golint goimports gotree gowhich (download) (download) (download)
~ $ tree -L 3 /tmp/gopath/src/
│   └── p
│       └──
    └── rjeczalik
        ├── tools
        └── which

7 directories, 0 files


Command gobin can update single executable or automagically discover all of them in directories specified in $GOPATH, $GOBIN and $GOPATH environment variables.

Executing gobin without any arguments makes it list all Go executables found in $GOPATH, $GOBIN and $GOPATH.

Updating multiple executables is performed on multiple goroutines, bumping up $GOMAXPROCS environment variable may speed up the overall run-time significantly.


~ $ GOMAXPROCS=2 gobin -u
ok 	/home/rjeczalik/bin/goimports	(	13.966s
ok 	/home/rjeczalik/bin/godoc	(	17.960s
ok 	/home/rjeczalik/bin/pulsecli	(	13.052s
ok 	/home/rjeczalik/workspace/bin/pulsecli	(	13.052s


    gobin - looks for Go executables system-wide ($PATH/$GOBIN/$GOPATH),
            lists them, fetches their sources and updates them

    gobin [-u] [-s=.|gopath] [path|package...]

    -u                Updates Go binaries
    -s <dir>          Go-gets sources for Go specified binaries into <dir> $GOPATH
                      (use '.' for current $GOPATH)
    -ldflags=<flags>  passes "-ldflags=flags" to "go install"

    gobin                    Lists all Go binaries (looks up $PATH/$GOBIN/$GOPATH)
    gobin -s=. ~/bin         Go-gets sources used to build all Go binaries in ~/bin
                             into current $GOPATH
    gobin -s=/var/mirror     Go-gets all sources used to build all Go binaries found
                             on system into new /var/mirror $GOPATH
    gobin -u                 Updates all Go binaries
    gobin -u      Updates all Go binaries installed from
    gobin ~/bin              Lists all Go binaries from the ~/bin directory

Package Files


Package main imports 8 packages (graph). Updated 2019-01-20. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).