main: fix multiple errors being reported as one

This commit is contained in:
Ayke van Laethem
2019-05-08 15:59:41 +02:00
committed by Ron Evans
parent 141a70f401
commit 08ee1916f5
+4 -1
View File
@@ -103,7 +103,10 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act
// Compile Go code to IR.
errs := c.Compile(pkgName)
if errs != nil {
if len(errs) != 0 {
if len(errs) == 1 {
return errs[0]
}
return &multiError{errs}
}
if config.printIR {