0

Why does it makes sense? I can think of many reasons i want many workspaces:

  1. I work for two companies.
  2. I have home projects and work projects.
  3. I have multiple go versions.
  4. I'm working on two versions of a library
Steven Doggart
  • 43,358
  • 8
  • 68
  • 105
Jas
  • 14,493
  • 27
  • 97
  • 148
  • 1
    current go supports vendoring so 4 won't be a problem: https://golang.org/cmd/go/#hdr-Vendor_Directories – ymonad Jan 27 '17 at 07:46

2 Answers2

2

GOPATH simplify automation, developers tools heavily use it which was design goal. And GOPATH like OS PATH is a list i.e.

export GOPATH = PATH1:PATH2:PATH3

that can answer some your questions.

Uvelichitel
  • 8,220
  • 1
  • 19
  • 36
0

Using an GOPATH workspace is usefull to keep all the installed packages or binaries in the same folders to make the developer's job easier. You are not bound to use it straight forward. Since the compiler doesn't care about you're go files path, you can always create a separate folder for you're projects, just specify the entry file and the output of the compiled file..as simple as that ;)

Razvan Alex
  • 1,706
  • 2
  • 18
  • 21