Error implements the error interface.
()
| 85 | |
| 86 | // Error implements the error interface. |
| 87 | func (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. |