package packages
import (
)
func ( *golistState) () (map[string]string, error) {
, := .getEnv()
if != nil {
return nil,
}
if ["GOMOD"] != "" {
.rootsOnce.Do(func() {
.rootDirs, .rootDirsError = .determineRootDirsModules()
})
} else {
.rootsOnce.Do(func() {
.rootDirs, .rootDirsError = .determineRootDirsGOPATH()
})
}
return .rootDirs, .rootDirsError
}
func ( *golistState) () (map[string]string, error) {
, := .invokeGo("list", "-m", "-json", "all")
if != nil {
var error
, = .invokeGo("list", "-m", "-json")
if != nil {
return nil,
}
}
:= map[string]string{}
:= map[string]string{}
var int
for := json.NewDecoder(); .More(); {
:= new(gocommand.ModuleJSON)
if := .Decode(); != nil {
return nil,
}
if .Dir != "" && .Path != "" {
, := .cfg.abs(.Dir)
if != nil {
return nil,
}
[] = .Path
if == 0 || .Replace != nil && .Replace.Path != "" {
[] = .Path
}
}
++
}
return , nil
}
func ( *golistState) () (map[string]string, error) {
:= map[string]string{}
for , := range filepath.SplitList(.mustGetEnv()["GOPATH"]) {
, := filepath.Abs()
if != nil {
return nil,
}
[filepath.Join(, "src")] = ""
}
return , nil
}