GOPATH is a list <https://golang.org/cmd/go/#hdr-GOPATH_environment_variable>, though it usually only contains one element. The first element in the list is the leftmost one (e.g., GOPATH=first:second:last).
GOROOT holds the standard library, so those packages must be findable. The standard library is distributed as source. On Tuesday, February 21, 2017 at 5:51:10 PM UTC+1, so.q...@gmail.com wrote: > > Thanks! > > what do you mean by "from left to right"? > And by GOROOT, you mean it looks at the go source? > > > > On Tuesday, February 21, 2017 at 1:27:59 AM UTC-8, Nathan Kerr wrote: >> >> Relative package don't need to be searched for, they are explicit >> (indicated with ./ or ../) >> >> Then it seems to be: >> >> 1. vendor tree, if it exists >> 2. GOROOT >> 3. GOPATH, from left to right >> >> Trying to build a package with an import that cannot be found will >> display an error listing all the locations it looked for the package. To >> get the vendor tree listed, a vendor directory must exist in the package >> you are trying to build. >> >> >> On Tuesday, February 21, 2017 at 3:01:59 AM UTC+1, so.q...@gmail.com >> wrote: >>> >>> What is the search order for the import path? >>> for example, relative then vendor then workspace? >>> >>> >>> -- 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.