errors v0.7.0 Release Notes
Release Date: 2016-06-14 // almost 8 years ago-
What's new since version 0.6.0
๐ฆ 0.7.0 removes the deprecated
errors.Location
anderrors.Stack
interfaces, and theerrors.Fprint
helper. Types returned from this package now implement thefmt.Formatter
interface and can print themselves when passed tofmt.Printf
and friends.For example:
- ๐จ
fmt.Printf("%s\n", err)
will print the message of the error as per normal, recursive if the underlying error has aCause
method. - ๐จ
fmt.Printf(%v\n", err)
operates the same as%s
. - ๐จ
fmt.Printf(%+v\n", err)
prints the error message as above, then prints a stack trace of the point that the error was created witherrors.New
,errors.Errorf
, etc.
๐ฆ This new behaviour is described in this blog post.
Other changes in 0.7.0 include:
- ๐ The
Stacktrace() []Frame
interface method was renamed toStackTrace() StackTrace
. Please note the change in capitalisation. The previous interface was added in 0.6.0 so hopefully this change will not cause to many breaking changes. The name and signature of the method is not expected to change again in the future. Fixes #50.
๐ Bug fixes
- ๐ฆ
README.md
incorrectly reported the licence of this package as MIT, not BSD 2 clause, this has been rectified. Thanks @anthonyfok. Fixes #41.
- ๐จ