Go Get Error With Babun Shell
Quick one here, if you run into the following error when trying to download a go package using Babun
1go get -u -v github.com/cosiner/argv
2github.com/cosiner/argv (download)
3# cd .; git clone https://github.com/cosiner/argv C:\Users\Mohammad Al-Shami\go\src\github.com\cosiner\argv
4Cloning into 'C:\Users\Mohammad Al-Shami\go\src\github.com\cosiner\argv'...
5fatal: Invalid path '/cygdrive/c/Users/Mohammad Al-Shami/Desktop/go/C:\Users\Mohammad Al-Shami\go\src\github.com\cosiner\argv': No such file or directory
6package github.com/cosiner/argv: exit status 128
This is because Babun comes with it’s own version of git which is Unix based and doesn’t understand Windows file paths. A simple solution is to use the Windows version of git and give it a higher priority.
1# ~/.zshrc
2
3export PATH=/c/bin/git/bin:$PATH
Just restart your shell or source ~/.zshrc and you’re ready to go.
Happy development.
About Me
Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.
Recent Posts