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

Method Error

private/bufpkg/bufmodule/errors.go:87–105  ·  view source on GitHub ↗

Error implements the error interface.

()

Source from the content-addressed store, hash-verified

85
86// Error implements the error interface.
87func (m *ModuleCycleError) Error() string {
88 if m == nil {
89 return ""
90 }
91 var builder strings.Builder
92 _, _ = builder.WriteString("cycle detected in module dependencies:\n")
93 for i, description := range m.Descriptions {
94 if i == 0 {
95 _, _ = builder.WriteString(" ")
96 } else {
97 _, _ = builder.WriteString(" -> ")
98 }
99 _, _ = builder.WriteString(description)
100 if i != len(m.Descriptions)-1 {
101 _, _ = builder.WriteString("\n")
102 }
103 }
104 return builder.String()
105}
106
107// DuplicateProtoPathError is the error returned if a .proto file with the same path
108// is detected in two or more Modules.

Callers 4

TestModuleCycleErrorFunction · 0.45
TestNoProtoFilesErrorFunction · 0.45
ErrorMethod · 0.45

Calls 1

StringMethod · 0.65

Tested by 3

TestModuleCycleErrorFunction · 0.36
TestNoProtoFilesErrorFunction · 0.36