Error implements the error interface.
()
| 50 | |
| 51 | // Error implements the error interface. |
| 52 | func (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. |
| 73 | func (i *ImportNotExistError) Unwrap() error { |
nothing calls this directly
no test coverage detected