Fail earlier if Go is not available
Этот коммит содержится в:
родитель
ea183e9197
коммит
cdf785629a
1 изменённых файлов: 3 добавлений и 3 удалений
|
@ -191,6 +191,9 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||
lprogram, err := loader.Load(config, pkgName, config.ClangHeaders, types.Config{
|
||||
Sizes: compiler.Sizes(machine),
|
||||
})
|
||||
if err != nil {
|
||||
return BuildResult{}, err
|
||||
}
|
||||
result := BuildResult{
|
||||
ModuleRoot: lprogram.MainPkg().Module.Dir,
|
||||
MainDir: lprogram.MainPkg().Dir,
|
||||
|
@ -200,9 +203,6 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||
// If there is no module root, just the regular root.
|
||||
result.ModuleRoot = lprogram.MainPkg().Root
|
||||
}
|
||||
if err != nil { // failed to load AST
|
||||
return result, err
|
||||
}
|
||||
err = lprogram.Parse()
|
||||
if err != nil {
|
||||
return result, err
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче