Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not since 2019: https://blog.golang.org/using-go-modules

The project has to opt into it, which appears to be the case here since there is a `go.mod` file. Are you using a modern version of Go?



If you opt into modules, modules get stored in GOPATH. If you don't use modules...source gets downloaded into GOPATH. If GOPATH is unset, it uses ~/go.


1. If you opt into modules, $GOMODCACHE is used for go mod downloads. It defaults to $GOPATH/pkg/mod.

2. If you don't use modules, $GOPATH is used.

3. If $GOPATH isn't set, it defaults to ~/go.


Actually, modules are still downloaded to a global location, they are not copied locally to your project by default.


Well yes, but most languages have some kind of cache in the home folder.


So yes, go does "assume that you have a directory in $HOME that is for it's own personal use?"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: