Created
May 6, 2016 16:51
-
-
Save OneOfOne/b84aadccfe990e2c7f2832895999a2b2 to your computer and use it in GitHub Desktop.
go.fish, I amuse myself sometimes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -gx PATH $PATH "/usr/src/go/bin" | |
| if test -d "$HOME/code/go" | |
| set -xg GOPATH "$HOME/code/go" | |
| set -xg PATH $PATH "$GOPATH/bin" | |
| end | |
| function rebuild-go | |
| pushd /usr/src/go/src | |
| git reset --hard | |
| git clean -fdx | |
| git pull; or return 1 | |
| rm -rf ../pkg ../bin | |
| rm-go-pkgdir | |
| set -xl CC clang | |
| set -xl GOGC off | |
| set -xl GOROOT_BOOTSTRAP "/usr/src/go1.4" | |
| #set -xl GO_GCFLAGS "-newexport=0" | |
| ./make.bash ; or return 1 | |
| echo updating golang.org/x/... | |
| go get -u golang.org/x/... | |
| echo updating gocode | |
| go get -u github.com/nsf/gocode; and gocode -sock unix close | |
| echo updating dlv | |
| go get -u github.com/derekparker/delve/cmd/dlv | |
| echo updating lukehoban repos | |
| go get -u github.com/lukehoban/... | |
| #env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 ./make.bash --no-clean | |
| #env GOOS=windows GOARCH=386 CGO_ENABLED=1 ./make.bash | |
| popd | |
| end | |
| function go-win64 | |
| env GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" go $argv | |
| end | |
| function go-win32 | |
| env GOOS="windows" GOARCH="386" CGO_ENABLED="1" CC="i686-w64-mingw32-gcc" CXX="i686-w64-mingw32-g++" go $argv | |
| end | |
| function rm-go-pkgdir | |
| test -d "$GOPATH/pkg/"; and rm -rf "$GOPATH/pkg/" | |
| end | |
| function set-go | |
| echo ln -fs /usr/src/go"$argv"/bin/go ~/bin/go | |
| ln -sf /usr/src/go"$argv"/bin/go ~/bin/go | |
| end | |
| alias go16 /usr/src/go1.6/bin/go | |
| alias go15 /usr/src/go1.5/bin/go | |
| alias go14 /usr/src/go1.4/bin/go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment