Mastodon Mastodon - GOPATH and GOROOT
 logo
  • Home 
  • Tags 
  • Blog posts 
  1. Home
  2. Blog posts
  3. GOPATH and GOROOT

GOPATH and GOROOT

Posted on August 16, 2021  (Last modified on July 11, 2024) • 1 min read • 119 words
Cli   Go   Tools: Hugo   Tools  
Cli   Go   Tools: Hugo   Tools  
Share via

go has some unique concepts, one of them is a system-wide (user-wide) central go directory where things “happen” (e.g. modules being downloaded, etc.). For example, if you perform hugo mod get you essentially perform go mod get, which then downloads required modules … into your $GOPATH. Or $GOROOT/something, I really don’t quite get it, and I don’t care unless it stops working. Which it did.

You often read “Just look into $GOPATH and see if it’s there”. Unfortunately I never set the value so there is no environment variable. The default of $HOME/go does not exist on my mac. Now what?

Thanks to 0x434d53 I now know to do this, which prints the values used by go:

go env
 remark42 comments
Completely delete teams on a Mac 
In case you want to follow me

Here are some links. The further to the right, the less active.

           
(c) Axel Bock | Powered by Hinode.
Link copied to clipboard
Code copied to clipboard