MCPcopy Create free account
hub / github.com/bufbuild/buf / Error

Method Error

private/bufpkg/bufmodule/errors.go:52–70  ·  view source on GitHub ↗

Error implements the error interface.

()

Source from the content-addressed store, hash-verified

50
51// Error implements the error interface.
52func (i *ImportNotExistError) Error() string {
53 if i == nil {
54 return ""
55 }
56 var builder strings.Builder
57 if i.fileInfo != nil {
58 if externalPath := i.fileInfo.ExternalPath(); externalPath != "" {
59 _, _ = builder.WriteString(externalPath)
60 _, _ = builder.WriteString(`: `)
61 }
62 }
63 if i.importPath != "" {
64 _, _ = builder.WriteString(`import "`)
65 _, _ = builder.WriteString(i.importPath)
66 _, _ = builder.WriteString(`": `)
67 }
68 _, _ = builder.WriteString(i.Unwrap().Error())
69 return builder.String()
70}
71
72// Unwrap returns fs.ErrNotExist.
73func (i *ImportNotExistError) Unwrap() error {

Callers

nothing calls this directly

Calls 4

UnwrapMethod · 0.95
ExternalPathMethod · 0.65
StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected