There are two parts in your question: Am Freitag, 23. September 2016 06:13:30 UTC+2 schrieb leon.j...@gmail.com: > > [...] > Do I have to manually symlink /usr/local/go/bin/go to my PATH because the > GOPATH docs lead me to believe that GOPATH to need to be set to the > directory where my go code is located. >
1. Normally you append /usr/local/go/bin to your PATH variable so that you can execute the go command by typing "go" in your terminal instead of having to type "/usr/local/go/bin/go". This is for your convenience and completely unrelated to your Go source code. (Note that no symlinking is done anywhere and this really not related to anything GOPATH is set to or not set to.) 2. Example of my code directories: > > git > ├── bitbucket > │ └── demo1 > ├── github > │ ├── notes > │ ├── scripts > │ └── snippets > ├── github-work > │ ├── ruby-app1 > │ ├── ruby-app2 > │ └── ruby-app3 > └── gitlab > ├── javascript-app1 > ├── python-app1 > └── (go-app1) > > I'd like to be able to keep this structure the same, but I don't see how > this is possible with GOPATH pointing to a single directory. > > What if I want to organize my code by version control location and not by > language? > The documentation on GOPATH i pretty clear: You do not have any choices, you must organise your code in one particular way. GOPATH may point to several distinct directories (GOPATH is a list like PATH is), but this still does not permit your desired code layout as each entry in GOPATH must stick to the convention. If you really want to keep this layout you can always use the Go compiler directly, typically driven through a Makefile. As you are new to Go this will be a _major_ pain for you (it is a major pain for experienced Gophers), maybe even undoable. There is no reason to not put you Go code in a GOPATH and go tool compatible structure. V. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.