MCPcopy
hub / github.com/google/mtail / Error

Method Error

internal/runtime/compiler/errors/errors.go:40–52  ·  view source on GitHub ↗

ErrorList implements the error interface.

()

Source from the content-addressed store, hash-verified

38
39// ErrorList implements the error interface.
40func (p ErrorList) Error() string {
41 switch len(p) {
42 case 0:
43 return "no errors"
44 case 1:
45 return p[0].Error()
46 }
47 var r strings.Builder
48 for _, e := range p {
49 r.WriteString(fmt.Sprintf("%s\n", e))
50 }
51 return r.String()[:r.Len()-1]
52}
53
54func Errorf(format string, args ...interface{}) error {
55 return errors.Errorf(format, args...)

Callers 1

TestNilErrorPositionFunction · 0.95

Calls 3

LenMethod · 0.80
ErrorMethod · 0.65
StringMethod · 0.65

Tested by 1

TestNilErrorPositionFunction · 0.76