I'm not entirely following what you are doing. But here are some comments. You have a directory $HOME/go, the contents of which look like what you would see under $GOPATH. If you are going to create a project under $HOME/go (whether GOPATH is defined or not), the suggested place to put it is in $HOME/go/src/urlShortener or perhaps $HOME/go/src/github.com/yourID/urlShortener. Having said that, using the same version of Go I am able to do the following without error:
unset GOPATH cd /tmp mkdir urlShortener cd urlShortener go mod init urlShortener go get github.com/fasthttp/router etc... Works for me. On Sunday, 10 January 2021 at 16:59:55 UTC-8 joseph.p...@gmail.com wrote: > I found (what I think is) a simple GO project to play with as a learning > exercise: > > > https://intersog.com/blog/how-to-write-a-custom-url-shortener-using-golang-and-redis/ > > The second step fails immediately. with the aforementioned error message. > > I'm using GO version 1.15.6 > $GOPATH is undefined. > Here's the content of ~/go > > Joes-iMac:go joe$ pwd > > /Users/joe/go > > Joes-iMac:go joe$ ls > > bin go.mod pkg src > > Joes-iMac:go joe$ more go.mod > > module urlShorter > > > go 1.15 > > [eof] > > So, I googled for the error message. I find lots of hits, but no clear > explanation of why the error message, but most importantly, no clear > explanation of how to fix... > > Help please! > > Thanks, > > Joe > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f0b5be67-a41d-4953-b65a-102309a232d4n%40googlegroups.com.