Source File
error.go
Belonging Package
src.elv.sh/pkg/diag
package diagimport// Error represents an error with context that can be showed.type Error struct {Type stringMessage stringContext Context}// Error returns a plain text representation of the error.func ( *Error) () string {return fmt.Sprintf("%s: %d-%d in %s: %s",.Type, .Context.From, .Context.To, .Context.Name, .Message)}// Range returns the range of the error.func ( *Error) () Ranging {return .Context.Range()}// Show shows the error.func ( *Error) ( string) string {:= fmt.Sprintf("%s: \033[31;1m%s\033[m\n", .Type, .Message)return + .Context.ShowCompact(+" ")}
The pages are generated with Golds v0.2.8-preview. (GOOS=darwin GOARCH=arm64)