should close #136
Этот коммит содержится в:
родитель
d0006ef306
коммит
857a19d0bf
1 изменённых файлов: 9 добавлений и 4 удалений
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче