* Jan Mercl <[email protected]> [210120 09:32]: > On Wed, Jan 20, 2021 at 2:58 PM Marvin Renich <[email protected]> wrote: > > > The error message is really incomplete, and therefore confusing. It > > should be "package ... is not in GOROOT or any element of GOPATH". > > _That_ would be incorrect and confusing. Reserved import paths are > never searched for in GOPATH.
I don't understand what you are saying. What is a "reserved import path" and where is it defined? When using GOPATH (not modules), when the go toolchain encounters import "path/to/package" it first looks for a directory obtained from (roughly) filepath.Join(GOROOT, "src", "path/to/package"), if it does not find the package there, it does the same thing, replacing GOROOT with, successively, each element of GOPATH. So, if it cannot find the given import path, then the package is not in GOROOT, nor is it in any element of GOPATH. What is confusing about that? ...Marvin -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/20210120145736.32uiaivzhtlo6dn4%40basil.wdw.
