-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Install Go. | ||
|
||
# Shell Support | ||
# shellcheck disable=SC1090 | ||
[[ -z "$SHELLSUPPORT" ]] && . "$( cd "${BASH_SOURCE%/*}/.." && pwd )/shell/support.sh" | ||
|
||
if ! type "go" &> /dev/null || [[ "$OSTYPE" == "darwin"* ]]; then | ||
sh_info "Installing Go..." | ||
if type "brew" &> /dev/null; then | ||
brew install go | ||
elif type "apt-get" &> /dev/null; then | ||
sudo apt-get -y install go | ||
elif type "yum" &> /dev/null; then | ||
sudo yum install go | ||
fi | ||
fi | ||
|
||
if type "go" &> /dev/null; then | ||
sh_success "$(go version) installed: $(command -v go)" | ||
|
||
sh_info "Setting up Go workspace file structure (~/go)..." | ||
mkdir -p "$HOME"/go/{bin,src,pkg} | ||
ls -al "$HOME/go" | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
[[ -d "$HOME/go" ]] && export GOPATH="$HOME/go" | ||
[[ -d "$(brew --prefix golang)/libexec" ]] && export GOROOT="$(brew --prefix golang)/libexec" | ||
[[ -d "${GOPATH}/bin" ]] && export PATH="$PATH:${GOPATH}/bin" | ||
[[ -d "${GOROOT}/bin" ]] && export PATH="$PATH:${GOROOT}/bin" |