Skip to content

Instantly share code, notes, and snippets.

@travisjeffery
Created November 1, 2017 05:35
Show Gist options
  • Save travisjeffery/3aae285aa8afa5e01fa3b9f91ef64763 to your computer and use it in GitHub Desktop.
Save travisjeffery/3aae285aa8afa5e01fa3b9f91ef64763 to your computer and use it in GitHub Desktop.
// error.go
// assert Error implements the error interface.
var _ error = &Error{}
// Error implements the error interface.
func (e *Error) Error() string {
b := new(bytes.Buffer)
e.printStack(b)
pad(b, ": ")
b.WriteString(e.Message)
if b.Len() == 0 {
return "no error"
}
return b.String()
}
@Depressed12345
Copy link

what is it for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment