Skip to content

Commit

Permalink
Fix GitHub Actions (#254)
Browse files Browse the repository at this point in the history
* add 1.14.1 and 1.13.9 (#116)

* 🎉 add 1.14.1

* 🎉 add 1.13.9

* 💚 Fix order

* add 1.14.2 and 1.13.10 (#120)

* Add ZPlug installation instructions (#122)

* add 1.14.3 and 1.13.11 (#124)

* 🎉 add 1.14.3

* 🎉 add 1.13.10

* automatic shims (#119)

#30

Thanks for https://github.com/kadaan
#30 (comment)
https://github.com/kadaan/goenv-goget-rehash

* add 1.14.4 and 1.13.12 (#125)

* 🎉 add 1.14.4

* 🎉 add 1.13.12

* 🎉 add 1.15beta1 (#126)

* Remove duplicate test (#128)

* Remove duplicate test

* Set specific bats version

* add 1.14.5 and 1.13.13 (#127)

* 🎉 add 1.14.5

* 🎉 add 1.13.13

* 👍 Update hash for go1.14.5.darwin-amd64.tar.gz

* add 1.14.6 and 1.13.14 (#129)

* 🎉 add 1.14.6

* 🎉 add 1.13.14

* 🐛 Change link from Installer to Archive for Go Darwin 64bit 1.13.13

* add 1.15rc2 (#134)

* 🎉 add 1.15rc2

* Add test

* add 1.13.15 (#137)

* add 1.13.15

* add 1.13.15

* 🎉 add 1.15.0 (#138)

* add 1.14.7 (#135)

* Add 1.15.1 and 1.14.8 (#139)

* 🎉 add 1.15.1

* 🎉 add 1.14.8

* 🐛 Change tab to white space

* 🐛 Change tab to white space

* supper go1.15.2 (#142)

Co-authored-by: yunling.zhang <[email protected]>
Co-authored-by: Anton Antonov <[email protected]>

* add 1.14.9 (#141)

Co-authored-by: Anton Antonov <[email protected]>

* Add 1.15.3 and 1.14.10 (#149)

* 🎉 add 1.15.3

* 🎉 add 1.15.3

* 🎉 add 1.14.10

* search relative to bin_path for plugins (#146)

* search relative to bin_path for plugins

* search relative to bin_path for plugins

* Add 1.15.4 and 1.14.11 (#152)

* 🎉 add 1.15.4

* 🎉 add 1.14.11

* Add 1.15.5 and 1.14.12 (#153)

* 🎉 add 1.15.5

* 🎉 add 1.14.12

* Add 1.15.6 and 1.14.13 (#154)

* 🎉 Add 1.15.6

* 🎉 add 1.14.13

* 🎉 add 1.16beta1 (#155)

* Support darwin-arm64 arch in 1.16beta1 (#158)

* Add Linux arm 64bit (#159)

* Add 1.15.7 and 1.14.14 (#160)

* 🎉 add 1.15.7

* 🎉 add 1.14.14

* Add GOENV_APPEND_GOPATH and GOENV_PREPEND_GOPATH (#148)

This adds two new environment variable options to optionally persist
user-configured GOPATH when enabled.

* clean up init function (#161)

- always export GOENV_ROOT
- do not append to PATH if entry already exists

* Add 1.15.8 and 1.14.15 (#162)

* add 1.15.8

* Add 1.14.15

* Add Go 1.16 (#164)

* Fix linux arm 64bit version in link (#166)

* Add 1.15.9 and 1.16.1 (#165)

* Add 1.15.9

* Add 1.16.1

* Add go 1.15.10 and 1.16.2 (#167)

* add 1.15.10

* add 1.16.2

* ISSUE-169: GOENV_GOPATH_PREFIX does not work as expected (#170)

* ISSUE-169: GOENV_GOPATH_PREFIX does not work as expected

When rehash is executed and GOENV_DISABLE_GOPATH is 0 (default)
the code should use currentVersionName instead becasue GOENV_VERSION is
not set.

* Fix OSX builds

* Update osx_image to latest Xcode

* Add go1.16.3 (#174)

Co-authored-by: Henry Nguyễn <[email protected]>

* 🎉 add 1.15.11 (#175)

* Use a POSIX-compatible regex in goenv-version-file-read (#176)

* Add 1.16.4 and 1.15.12 (#178)

* Add 1.16.5 and 1.15.13 (#181)

* Add 1.16.6, 1.15.14 and 1.17beta1 (#183)

* Add 1.16.6 and 1.15.14

* Add 1.17beta1

* Add 1.17rc1 (#185)

* Show progress bar during download tarball (#187)

* Add 1.15.15, 1.16.7 and 1.17rc2 (#189)

* Add 1.17rc2

* Add 1.16.7 and 1.15.15

* Add 1.17 (#193)

* Add 1.17.1 and 1.16.8 (#195)

* Add 1.17.2 and 1.16.9 (#196)

* Use correct checksum for Go Darwin arm 1.17.2 (#197)

* Add 1.17.3 and 1.16.10 (#199)

* test_assert_helper: use type -aP instead of which -a (#201)

which might not be installed, but type is a bash builtin.

* Add 1.17.4, 1.17.5, 1.16.11 and 1.16.12 (#204)

* Add 1.17.4 and 1.16.11

* Add 1.17.5 and 1.16.12

* Add 1.18beta1 (#208)

* Add 1.17.6 and 1.16.13 (#211)

Co-authored-by: Anton Antonov <[email protected]>

* Update realpath extension source with upstream changes (#206)

This fixes building the extension on macOS 12.

* Add 1.18beta2 (#212)

* Add 1.16.14 & 1.17.7 (#213)

* Adds support for 1.18rc1 release (#214)

* add 1.17.8 and 1.16.15 (#216)

* Support go 1.18.0 (#217)

Signed-off-by: moznion <[email protected]>

* support 1.18.1 (#219)

* Support go 1.17.9 (#221)

* feat: suport force darwin arch (#220)

* Go 1.18.2 (#224)

* Support Go 1.18.2

* fix tests

* Add Go 1.17.10 (#225)

* Support Go 1.18.3 (#228)

Co-authored-by: Henry <[email protected]>

* fix tar.gz MacOS checksum (#229)

* Support go 1.17.11 (#231)

* Add go1.19beta1 support (#232)

* Support Go 1.18.4 and 1.17.12 (#236)

* Support Go 1.18.4

* Support Go 1.17.12

* Remove redundant command prompts (#235)

* Support Go 1.18.5 and 1.17.13 (#239)

* Support Go 1.18.5

* Support Go 1.17.3

* Add go1.19.0 support (#240)

* Doc: simplify git cmd for upgrade & checkout version (#242)

* Support Go 1.19.1 and 1.18.6 (#245)

* Support Go 1.19.1

* Support Go 1.18.6

* If `.go-version` is missing, fallback on `go.mod` (#227)

* First step: attempting to make `goenv-version-file` and `goenv-version-file-read` to fallback on `go.mod`

* simplify go mod parsing

* fix existing unit tests

* add unit tests for go mod

* add feat flag constraint

* add negative test case for feature flag as well

Co-authored-by: ChronosMasterOfAllTime <[email protected]>

* Support 1.19.2 and 1.18.7 (#250)

* support 1.19.2 and 1.18.7

* add new versions to bats

* Add github action

* Test

* keep contexts of shell in makefile per step

* update runner file

* rename blank.yml -> pr_checks.yml

* try default shell of bash in makefile

* print bash version

* force bash

* try only awk?

* Try gawk

* is go installed

* try to remove golang

* root

* remove golang

* back to awk

* check macos version print out

* try the read method for populating the array

* try thetrim method

* use zero index macOS

* fix runner and add status badge

Signed-off-by: moznion <[email protected]>
Co-authored-by: Toshinori Sugita <[email protected]>
Co-authored-by: takisawa <[email protected]>
Co-authored-by: Andy Palmer <[email protected]>
Co-authored-by: ฐฏ <[email protected]>
Co-authored-by: Anton Antonov <[email protected]>
Co-authored-by: Willy Li <[email protected]>
Co-authored-by: Thibault NORMAND <[email protected]>
Co-authored-by: Joy_Zhang <[email protected]>
Co-authored-by: yunling.zhang <[email protected]>
Co-authored-by: David Tapiador <[email protected]>
Co-authored-by: cornfeedhobo <[email protected]>
Co-authored-by: ITO Nobuaki <[email protected]>
Co-authored-by: Shingo Kawamura <[email protected]>
Co-authored-by: kangaechu <[email protected]>
Co-authored-by: Radek Simko <[email protected]>
Co-authored-by: Ville Skyttä <[email protected]>
Co-authored-by: Aaron Russo <[email protected]>
Co-authored-by: Mark "debo" De Bortoli <[email protected]>
Co-authored-by: Henry <[email protected]>
Co-authored-by: Henry Nguyễn <[email protected]>
Co-authored-by: oshiro <[email protected]>
Co-authored-by: Bjorn Neergaard <[email protected]>
Co-authored-by: umatare5 <[email protected]>
Co-authored-by: Gareth Jones <[email protected]>
Co-authored-by: Ville Skyttä <[email protected]>
Co-authored-by: Martin Holman <[email protected]>
Co-authored-by: Colin Goodheart-Smithe <[email protected]>
Co-authored-by: Masa <[email protected]>
Co-authored-by: moznion <[email protected]>
Co-authored-by: Wenchao Hu <[email protected]>
Co-authored-by: Charlie Voiselle <[email protected]>
Co-authored-by: Luke Van Oort <[email protected]>
Co-authored-by: Pavlo Romanenko <[email protected]>
Co-authored-by: Henry <[email protected]>
Co-authored-by: Shuhei Kitagawa <[email protected]>
Co-authored-by: Filip Sergot <[email protected]>
Co-authored-by: Kohji Nakahata <[email protected]>
Co-authored-by: Chen Ni <[email protected]>
Co-authored-by: uedaeita <[email protected]>
Co-authored-by: LittleKey <[email protected]>
Co-authored-by: Alpha <[email protected]>
Co-authored-by: Ivan De Marino <[email protected]>
Co-authored-by: Koya IWAMURA <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 120 changed files with 2,466 additions and 460 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI
on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- "*"
jobs:
build:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]
goenv_native_ext: ["", "1"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Remove golang
run: sudo rm -rf $(which go)
- name: Run Unit Tests
run: make test
env:
GOENV_NATIVE_EXT: ${{ matrix.goenv_native_ext }}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ os:
# NOTE: Use `xenial` and/or newer since `make`
# bundled there is new enough version to support `.ONESHELL` in `Makefile`.
dist: xenial
osx_image: xcode12.2
addons:
homebrew:
brewfile: true
Expand Down
3 changes: 3 additions & 0 deletions ENVIRONMENT_VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ name | default | description
`GOENV_DISABLE_GOROOT` | `0` | Disables management of `GOROOT`.<br> Set this to `1` if you want to use a `GOROOT` that you export.
`GOENV_DISABLE_GOPATH` | `0` | Disables management of `GOPATH`.<br> Set this to `1` if you want to use a `GOPATH` that you export. It's recommend that you use this (as set to `0`) to avoid mixing multiple versions of golang packages at `GOPATH` when using different versions of golang. See https://github.com/syndbg/goenv/issues/72#issuecomment-478011438
`GOENV_GOPATH_PREFIX` | `$HOME/go` | `GOPATH` prefix that's exported when `GOENV_DISABLE_GOPATH` is not `1`.<br> E.g in practice it can be `$HOME/go/1.12.0` if you currently use `1.12.0` version of go.
`GOENV_APPEND_GOPATH` | | If `GOPATH` is set, it will be appended to the computed `GOPATH`.
`GOENV_PREPEND_GOPATH` | | If `GOPATH` is set, it will be prepended to the computed `GOPATH`.
`GOENV_GOMOD_VERSION_ENABLE` | | if `GOENV_GOMOD_VERSION_ENABLE` is set to 1, it will try to use the project's `go.mod` file to get the version.
43 changes: 27 additions & 16 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ easy to fork and contribute any changes back upstream.
1. **Check out goenv where you want it installed.**
A good place to choose is `$HOME/.goenv` (but you can install it somewhere else).

$ git clone https://github.com/syndbg/goenv.git ~/.goenv
git clone https://github.com/syndbg/goenv.git ~/.goenv

2. **Define environment variable `GOENV_ROOT`** to point to the path where
goenv repo is cloned and add `$GOENV_ROOT/bin` to your `$PATH` for access
to the `goenv` command-line utility.

$ echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bash_profile
$ echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bash_profile
echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bash_profile

**Zsh note**: Modify your `~/.zshenv` file instead of `~/.bash_profile`.

Expand All @@ -25,7 +25,7 @@ easy to fork and contribute any changes back upstream.
Please make sure `eval "$(goenv init -)"` is placed toward the end of the shell
configuration file since it manipulates `PATH` during the initialization.

$ echo 'eval "$(goenv init -)"' >> ~/.bash_profile
echo 'eval "$(goenv init -)"' >> ~/.bash_profile

**Zsh note**: Modify your `~/.zshenv` or `~/.zshrc` file instead of `~/.bash_profile`.

Expand All @@ -40,8 +40,8 @@ easy to fork and contribute any changes back upstream.
4. **If you want `goenv` to manage `GOPATH` and `GOROOT` (recommended)**,
add `GOPATH` and `GOROOT` to your shell **after `eval "$(goenv init -)"`**.

$ echo 'export PATH="$GOROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bash_profile
echo 'export PATH="$GOROOT/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bash_profile
**Zsh note**: Modify your `~/.zshenv` or `~/.zshrc` file instead of `~/.bash_profile`.

Expand All @@ -62,12 +62,12 @@ easy to fork and contribute any changes back upstream.
5. **Restart your shell so the path changes take effect.**
You can now begin using goenv.

$ exec $SHELL
exec $SHELL

6. **Install Go versions into `$GOENV_ROOT/versions`.**
For example, to download and install Go 1.12.0, run:

$ goenv install 1.12.0
goenv install 1.12.0

**NOTE:** It downloads and places the prebuilt Go binaries provided by Google.

Expand All @@ -81,13 +81,25 @@ export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
```

## via ZPlug plugin manager for Zsh

Add the following line to your `.zshrc`:

```zplug "RiverGlide/zsh-goenv", from:gitlab```
Then install the plugin
~~~ zsh
source ~/.zshrc
zplug install
~~~
The ZPlug plugin will install and initialise `goenv` and add `goenv` and `goenv-install` to your `PATH`

## Homebrew on Mac OS X

You can also install goenv using the [Homebrew](http://brew.sh)
package manager for Mac OS X.

$ brew update
$ brew install goenv
brew update
brew install goenv

To upgrade goenv in the future, use `upgrade` instead of `install`.

Expand All @@ -102,16 +114,15 @@ upgrade your installation at any time using git.

To upgrade to the latest development version of goenv, use `git pull`:

$ cd ~/.goenv
$ git pull
cd ~/.goenv && git fetch --all && git pull

To upgrade to a specific release of goenv, check out the corresponding tag:

$ cd ~/.goenv
$ git fetch
$ git tag
cd ~/.goenv
git fetch --all
git tag
v20160417
$ git checkout v20160417
git checkout v20160417

## Uninstalling goenv

Expand Down
71 changes: 32 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SHELL:=/bin/bash
.ONESHELL:
.PHONY: test test-goenv test-goenv-go-build bats start-fake-go-build-http-server stop-fake-go-build-http-server run-goenv-go-build-tests

Expand All @@ -6,53 +7,45 @@ default: test
test: test-goenv test-goenv-go-build

test-goenv: bats
set -e
PATH="./bats-core/bin:$$PATH"

if [ -n "$$GOENV_NATIVE_EXT" ]; then
src/configure
make -C src
fi

test_target=$${test_target:-test}
exec bats $${CI:+--tap} $$test_target
set -e; \
PATH="./bats-core/bin:$$PATH"; \
if [ -n "$$GOENV_NATIVE_EXT" ]; then \
src/configure; \
make -C src; \
fi; \
test_target=$${test_target:-test}; \
exec bats $${CI:+--tap} $$test_target;

test-goenv-go-build: bats stop-fake-go-build-http-server start-fake-go-build-http-server run-goenv-go-build-tests stop-fake-go-build-http-server

stop-fake-go-build-http-server:
pkill fake_file_server || true

run-goenv-go-build-tests:
set -e
PATH="$$(pwd)/bats-core/bin:$$PATH"

if [ -n "$$GOENV_NATIVE_EXT" ]; then
src/configure
make -C src
fi

test_target=$${test_target:-test}

cd plugins/go-build
exec bats $${CI:+--tap} $$test_target
set -e; \
PATH="$$(pwd)/bats-core/bin:$$PATH"; \
if [ -n "$$GOENV_NATIVE_EXT" ]; then \
src/configure; \
make -C src; \
fi; \
test_target=$${test_target:-test}; \
cd plugins/go-build; \
exec bats $${CI:+--tap} $$test_target;

start-fake-go-build-http-server:
set -e

port=$${port:-8090}
cd plugins/go-build/test
(bash -c "exec -a fake_file_server python3 fake_file_server.py $$port") &

until lsof -Pi :$${port} -sTCP:LISTEN -t >/dev/null; do
echo "wait"
sleep 2
done
set -e; \
port=$${port:-8090}; \
cd plugins/go-build/test; \
(bash -c "exec -a fake_file_server python3 fake_file_server.py $$port") & \
until lsof -Pi :$${port} -sTCP:LISTEN -t >/dev/null; do \
echo "wait"; \
sleep 2; \
done;

bats:
set -e

if [ -d "$(PWD)/bats-core" ]; then
echo "bats-core already exists. Nothing to do" ;
else
git clone --depth 1 https://github.com/bats-core/bats-core.git ;
fi
set -e; \
if [ -d "$(PWD)/bats-core" ]; then \
echo "bats-core already exists. Nothing to do"; \
else \
git clone --depth 1 --single-branch --branch=v1.1.0 https://github.com/bats-core/bats-core.git; \
fi;
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Go Version Management: goenv

![PR Checks Status](https://github.com/syndbg/goenv/actions/workflows/pr_checks.yml/badge.svg)

[![Build Status](https://travis-ci.org/syndbg/goenv.svg?branch=master)](https://travis-ci.org/syndbg/goenv)

goenv aims to be as simple as possible and follow the already established
Expand All @@ -11,27 +13,26 @@ This project was cloned from [pyenv](https://github.com/yyuu/pyenv) and modified

### goenv _does..._

* Let you **change the global Go version** on a per-user basis.
* Provide support for **per-project Go versions**.
* Allow you to **override the Go version** with an environment
- Let you **change the global Go version** on a per-user basis.
- Provide support for **per-project Go versions**.
- Allow you to **override the Go version** with an environment
variable.
* Search commands from **multiple versions of Go at a time**.
- Search commands from **multiple versions of Go at a time**.

### goenv compared to others:

* https://github.com/pwoolcoc/goenv depends on Python,
* https://github.com/crsmithdev/goenv depends on Go,
* https://github.com/moovweb/gvm is a different approach to the problem that's modeled after `nvm`.
`goenv` is more simplified.
- https://github.com/pwoolcoc/goenv depends on Python,
- https://github.com/crsmithdev/goenv depends on Go,
- https://github.com/moovweb/gvm is a different approach to the problem that's modeled after `nvm`.
`goenv` is more simplified.

----
---

## Links

* **[How It Works](./HOW_IT_WORKS.md)**
* **[Installation](./INSTALL.md)**
* **[Command Reference](./COMMANDS.md)**
* **[Environment variables](./ENVIRONMENT_VARIABLES.md)**
* **[Contributing](./CONTRIBUTING.md)**
* **[Code-of-Conduct](./CODE_OF_CONDUCT.md)**

- **[How It Works](./HOW_IT_WORKS.md)**
- **[Installation](./INSTALL.md)**
- **[Command Reference](./COMMANDS.md)**
- **[Environment variables](./ENVIRONMENT_VARIABLES.md)**
- **[Contributing](./CONTRIBUTING.md)**
- **[Code-of-Conduct](./CODE_OF_CONDUCT.md)**
3 changes: 3 additions & 0 deletions libexec/goenv
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export GOENV_DIR
shopt -s nullglob

bin_path="$(abs_dirname "$0")"
for plugin_bin in "${bin_path%/*}/plugins/"*/bin; do
PATH="${plugin_bin}:${PATH}"
done
for plugin_bin in "${GOENV_ROOT}/plugins/"*/bin; do
PATH="${plugin_bin}:${PATH}"
done
Expand Down
58 changes: 41 additions & 17 deletions libexec/goenv-exec
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,60 @@ done
shift 1

if [ "${GOENV_VERSION}" != "system" ]; then
case "$shell" in
fish )
if [ "${GOENV_DISABLE_GOROOT}" != "1" ]; then
set -gx GOROOT "$(goenv-prefix)"
fi
case "$shell" in
fish)
if [ "${GOENV_DISABLE_GOROOT}" != "1" ]; then
set -gx GOROOT "$(goenv-prefix)"
fi

if [ "${GOENV_DISABLE_GOPATH}" != "1" ]; then
if [ -z "${GOENV_GOPATH_PREFIX}" ]; then
if [ "${GOENV_DISABLE_GOPATH}" != "1" ]; then
if [ -z "${GOENV_GOPATH_PREFIX}" ]; then
if [ -n "${GOPATH}" ] && [ "${GOENV_APPEND_GOPATH}" = "1" ]; then
set -gx GOPATH "${HOME}/go/${GOENV_VERSION}:${GOPATH}"
elif [ -n "${GOPATH}" ] && [ "${GOENV_PREPEND_GOPATH}" = "1" ]; then
set -gx GOPATH "${GOPATH}:${HOME}/go/${GOENV_VERSION}"
else
set -gx GOPATH "${HOME}/go/${GOENV_VERSION}"
else
fi
else
if [ -n "${GOPATH}" ] && [ "${GOENV_APPEND_GOPATH}" = "1" ]; then
set -gx GOPATH "${GOENV_GOPATH_PREFIX}/${GOENV_VERSION}:${GOPATH}"
elif [ -n "${GOPATH}" ] && [ "${GOENV_PREPEND_GOPATH}" = "1" ]; then
set -gx GOPATH "${GOPATH}:${GOENV_GOPATH_PREFIX}/${GOENV_VERSION}"
else
set -gx GOPATH "${GOENV_GOPATH_PREFIX}/${GOENV_VERSION}"
fi
fi
fi

;;
* )
if [ "${GOENV_DISABLE_GOROOT}" != "1" ]; then
export GOROOT="$(goenv-prefix)"
fi
;;
*)
if [ "${GOENV_DISABLE_GOROOT}" != "1" ]; then
export GOROOT="$(goenv-prefix)"
fi

if [ "${GOENV_DISABLE_GOPATH}" != "1" ]; then
if [ -z "${GOENV_GOPATH_PREFIX}" ]; then
if [ "${GOENV_DISABLE_GOPATH}" != "1" ]; then
if [ -z "${GOENV_GOPATH_PREFIX}" ]; then
if [ -n "${GOPATH}" ] && [ "${GOENV_APPEND_GOPATH}" = "1" ]; then
export GOPATH="${HOME}/go/${GOENV_VERSION}:${GOPATH}"
elif [ -n "${GOPATH}" ] && [ "${GOENV_PREPEND_GOPATH}" = "1" ]; then
export GOPATH="${GOPATH}:${HOME}/go/${GOENV_VERSION}"
else
export GOPATH="${HOME}/go/${GOENV_VERSION}"
fi
else
if [ -n "${GOPATH}" ] && [ "${GOENV_APPEND_GOPATH}" = "1" ]; then
export GOPATH="${GOENV_GOPATH_PREFIX}/${GOENV_VERSION}:${GOPATH}"
elif [ -n "${GOPATH}" ] && [ "${GOENV_PREPEND_GOPATH}" = "1" ]; then
export GOPATH="${GOPATH}:${GOENV_GOPATH_PREFIX}/${GOENV_VERSION}"
else
export GOPATH="${GOENV_GOPATH_PREFIX}/${GOENV_VERSION}"
fi
fi
fi

;;
esac
;;
esac
fi

export PATH="${GOENV_BIN_PATH}:${GOROOT}/bin:${PATH}"
Expand Down
4 changes: 2 additions & 2 deletions libexec/goenv-help
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extract_initial_comment_block() {
}

collect_documentation() {
$(type -p gawk awk | head -1) '
$(type -p awk | head -1) '
/^Summary:/ {
summary = substr($0, 10)
next
Expand Down Expand Up @@ -88,7 +88,7 @@ collect_documentation() {
documentation_for() {
local filename="$(command_path "$1")"
if [ -n "$filename" ]; then
extract_initial_comment_block < "$filename" | collect_documentation
extract_initial_comment_block <"$filename" | collect_documentation
fi
}

Expand Down
Loading

0 comments on commit 9d4cdd7

Please sign in to comment.