Lots of code cleanup, better error handling, etc...

This commit is contained in:
Gregory Kurtzer
2020-11-02 21:16:06 -08:00
parent 3ecd1056bc
commit 78b13b5b4b
13 changed files with 430 additions and 58 deletions

View File

@@ -0,0 +1,20 @@
package errors
type error interface {
Error() string
}
// errorString is a trivial implementation of error.
type errorString struct {
s string
}
func (e *errorString) Error() string {
return e.s
}
// New returns an error that formats as the given text.
func New(text string) error {
return &errorString{text}
}