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

it should have been `go mod init mything/mypackage` (without the `src/`) in the `GOPATH/src/mything/mypackage` directory, and `GOPATH=$PWD` is almost certainly wrong. The `go` command in module mode assumes independence from GOPATH, so to build something, you have to be "in" the module (under a directory with a `go.mod` file).


Thanks, I've been checking on project layouts, and I have mine definitely wrong / weird. Which is probably why I've made life difficult for myself.




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

Search: