Этот коммит содержится в:
gedi 2018-09-27 16:04:42 +03:00
родитель d0006ef306
коммит 857a19d0bf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 56604CDCCC201556

Просмотреть файл

@ -326,11 +326,16 @@ func buildTestMain(pkg *build.Package) ([]byte, bool, error) {
return nil, false, err return nil, false, err
} }
contexts = ctxs contexts = ctxs
// @TODO: is it a good indicator for packages outside GOPATH
if strings.Index(pkg.ImportPath, "_/") == 0 { // for module support, query the module import path
importPath = pkg.Name // @TODO: maybe there is a better way to read it
} else { out, err := exec.Command("go", "list", "-m").CombinedOutput()
if err != nil {
// is not using modules or older go version
importPath = pkg.ImportPath importPath = pkg.ImportPath
} else {
// otherwise read the module name from command output
importPath = strings.TrimSpace(string(out))
} }
name = pkg.Name name = pkg.Name
} }