Content-Length: 246298 | pFad | http://github.com/asdf-community/asdf-golang/commit/d4f1d65d597ac99a0190cd7d6efecf8666cecd26

7C Create set-env.bash (#147) · asdf-community/asdf-golang@d4f1d65 · GitHub
Skip to content

Commit

Permalink
Create set-env.bash (#147)
Browse files Browse the repository at this point in the history
* Create set-env.bash
* Update README.md
  • Loading branch information
ikuwow authored Sep 25, 2024
1 parent 159af62 commit d4f1d65
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ To set `GOROOT` in your shell's initialization add the following:
Add this to your env.nu
`source ('~/.asdf/plugins/golang/set-env.nu')`

**bash shell**
Add this to your .bashrc:
`. ~/.asdf/plugins/golang/set-env.bash`

## When using `go get` or `go install`

After using `go get` or `go install` to install a package you need to run `asdf reshim golang` to get any new shims.
Expand Down
17 changes: 17 additions & 0 deletions set-env.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
asdf_update_golang_env() {
local go_bin_path
go_bin_path="$(asdf which go 2>/dev/null)"
if [[ -n "${go_bin_path}" ]]; then
abs_go_bin_path="$(readlink -f "${go_bin_path}")"

export GOROOT
GOROOT="$(dirname "$(dirname "${abs_go_bin_path}")")"

export GOPATH
GOPATH="$(dirname "${GOROOT}")/packages"

export GOBIN
GOBIN="$(dirname "${GOROOT}")/bin"
fi
}
asdf_update_golang_env

0 comments on commit d4f1d65

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/asdf-community/asdf-golang/commit/d4f1d65d597ac99a0190cd7d6efecf8666cecd26

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy