aboutsummaryrefslogtreecommitdiffhomepage
path: root/builder/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'builder/error.go')
-rw-r--r--builder/error.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/builder/error.go b/builder/error.go
index 0f920a031..3531007fb 100644
--- a/builder/error.go
+++ b/builder/error.go
@@ -3,7 +3,8 @@ package builder
// MultiError is a list of multiple errors (actually: diagnostics) returned
// during LLVM IR generation.
type MultiError struct {
- Errs []error
+ ImportPath string
+ Errs []error
}
func (e *MultiError) Error() string {
@@ -15,14 +16,15 @@ func (e *MultiError) Error() string {
// newMultiError returns a *MultiError if there is more than one error, or
// returns that error directly when there is only one. Passing an empty slice
// will lead to a panic.
-func newMultiError(errs []error) error {
+// The importPath may be passed if this error is for a single package.
+func newMultiError(errs []error, importPath string) error {
switch len(errs) {
case 0:
panic("attempted to create empty MultiError")
case 1:
return errs[0]
default:
- return &MultiError{errs}
+ return &MultiError{importPath, errs}
}
}