diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-03-29 11:18:29 +0200 |
---|---|---|
committer | Tobias Klauser <klto@zhaw.ch> | 2010-03-29 11:18:29 +0200 |
commit | adb6c3da0890cdf63d7a17fd05339b93697ed6b6 (patch) | |
tree | 0c7d8ee6bdc4f58b561772f75495284c6e97a420 | |
parent | e14c3c7a7a3c91b25deb74249c5195c9e266f6c3 (diff) |
Add go environment settings
-rw-r--r-- | .zsh/zshenv/80_go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.zsh/zshenv/80_go b/.zsh/zshenv/80_go new file mode 100644 index 0000000..4ef13c9 --- /dev/null +++ b/.zsh/zshenv/80_go @@ -0,0 +1,28 @@ +# zshenv/80_go +# +# Set variables related to the Go programming language +# +# Copyright © 2010 Tobias Klauser <tklauser@distanz.ch> +# Released under the terms of the Artistic Licence 2.0 +# +# Source repository: git://git.distanz.ch/dotfiles/zsh.git + +_GOROOT=$HOME/src/go + +if [ -d $_GOROOT ] ; then + export GOROOT=$_GOROOT + arch="$(uname -m)" + case "$arch" in + x86_64) export GOARCH="amd64";; + i*86) export GOARCH="386";; + *) export GOARCH="unsupported";; + esac + os="$(uname)" + case "$os" in + Linux) export GOOS="linux";; + Darwin) export GOOS="darwin";; + *) export GOOS="unsupported";; + esac +fi + +# vim:ft=zsh |