MCPcopy Create free account
hub / github.com/tinygo-org/tinygo / newMultiError

Function newMultiError

builder/error.go:20–29  ·  view source on GitHub ↗

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 return nil (because there is no error). The importPath may be passed if this error is for a single package.

(errs []error, importPath string)

Source from the content-addressed store, hash-verified

18// will return nil (because there is no error).
19// The importPath may be passed if this error is for a single package.
20func newMultiError(errs []error, importPath string) error {
21 switch len(errs) {
22 case 0:
23 return nil
24 case 1:
25 return errs[0]
26 default:
27 return &MultiError{importPath, errs}
28 }
29}
30
31// commandError is an error type to wrap os/exec.Command errors. This provides
32// some more information regarding what went wrong while running a command.

Callers 3

parseLLDErrorsFunction · 0.85
BuildFunction · 0.85
optimizeProgramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected