0

Golang – GoEnv with versions 1.11+

If you have wondered why does you goenv is stuck on version 1.11.X then you probably missed on one of the open issues ( which btw is quite annoying to find )

brew install jq
if [ -n "$(brew info --json goenv | jq -r '.[0].installed[] | select(.version | test("^HEAD-") | not)')" ]; then
  brew uninstall goenv
fi
brew install --HEAD goenv

Once you execute the code above – you will be able to use up to date versions of go 🙂

0

golang modules – accessing local packages

Recently I was developing locally framework which I just wanted to test before pushing it anywhere to the clouds 🙂 It just so happens that testing when using modules is quite easy. The only thing you need to do is to update your go.mod file like that

module test-package

require github.com/abc/xyz v1.0.2
replace github.com/abc/xyz v1.0.2 => /Users/rafpe/xyz

From that point onward you can debug/make changes and try it all out before release.

Happy coding!