4 ms·
You can put your project in ~/work/my-go-project but then symlink it to ~/go/src/github.com/joshklien/my-go-project (assuming your $GOPATH is ~/go). But yes, w
by lsllc 8y ago
You can put your project in ~/work/my-go-project but then symlink it to ~/go/src/github.com/joshklien/my-go-project (assuming your $GOPATH is ~/go).
But yes, with modules you don't need to do this anymore.
go mod init github.com/joshklien/my-go-project
- hiimnate 8y agoNot all go tools respect symlinks, since Rob Pike decided that symlinks should not be supported. https://github.com/golang/go/issues/15507#issuecomment-241581036 https://github.com/golang/go/issues/15507#issuecomment-24158...
- nsajko 8y agoRelevant: https://news.ycombinator.com/item?id=3075522 https://news.ycombinator.com/item?id=3075522
- ihuman 8y agoWhere in your gopath are you supposed to put your source code if you never intend to upload it? All gopath tutorials I see say to put your github in the path like you did, and never say what to do if its not public.
- AgentME 8y agoIf your project isn't intended to be uploaded (or is, but isn't intended to be consumed by other go projects as a go module), then you can make the project name whatever you want as far as I know.