go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 571 forks source link

go workspace vs git repository vs idea workspace #1891

Open mcarifio opened 9 years ago

mcarifio commented 9 years ago

This might be more a documentation issue than a technical one.

https://golang.org/doc/code.html is opinionated about how your go workspace, including your source code, should be laid out. Likewise where your git repo should go. Intellij Idea defaults new go projects to ~/IdeaProjects/${go_project} and doesn't adhere that layout. So is it really a matter that when I create a new project I should just put it in the right place, like ${GOPATH}/src/${package}? Did I not read something tutorial? I just started using this without really reading a thing. A "hello world" thing worked after a little bit of fiddling with configuring GOROOT on Ubuntu.

dlsniper commented 9 years ago

Hi,

Thank you for feedback. With Go you can have applications outside of the GOPATH that compile just fine. As for how things should be created there are many options, varying with the different layouts that one could have:

As you said, it's that could be improved in the docs mostly, so any help in that regard would be useful. If you have any suggestion on how to improve presenting the above options / onboarding people, we'd be happy to hear. Looking forward for your thoughts on this.

dlsniper commented 9 years ago

Also, GOROOT is not needed, which version of the plugin are you using? Is it one of the latest nightly / alphas (see the README https://github.com/go-lang-plugin-org/go-lang-idea-plugin#pre-release-builds on how to get them).

parhamdoustdar commented 8 years ago

I have my environment set up the way you describe in item 1.

What works for me is to simply create the project under $GOPATH/src/<host.com>/<project>. As for other options, what about having the option to temporarily add the project directory to $GOPATH on build if it doesn't already exist in the variable?

zolotov commented 8 years ago

@parhamdoustdar all paths which are configured in Settings | Languages & Frameworks | Go | Go Libraries are added to $GOPATH on build.

parhamdoustdar commented 8 years ago

Ah, thanks.

On 2/14/2016 2:38 PM, Alexander Zolotov wrote:

@parhamdoustdar https://github.com/parhamdoustdar all paths that are configured in |Settings | Languages & Frameworks | Go | Go Libraries| are added to |$GOPATH| on build.

— Reply to this email directly or view it on GitHub https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/1891#issuecomment-183874520.