mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
Fail earlier if Go is not available
This commit is contained in:
committed by
Ron Evans
parent
ea183e9197
commit
cdf785629a
+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
|
||||
|
||||
Reference in New Issue
Block a user