Added print method to error

This commit is contained in:
Sasha Koshka 2022-08-09 20:12:33 -04:00
parent a755fc9f41
commit c23413eedf
1 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package file
import "os"
import "fmt"
type ErrorKind int
@ -70,3 +71,8 @@ func (err Error) Error () (formattedMessage string) {
return
}
// Print formats the error and prints it to stderr.
func (err Error) Print () {
os.Stderr.Write([]byte(err.Error()))
}