Added print method to error

This commit is contained in:
Sasha Koshka 2022-08-09 20:12:33 -04:00
parent a755fc9f41
commit c23413eedf

View File

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