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 and errors.Stack interfaces, and the errors.Fprint helper. Types returned from this package now implement the fmt.Formatter interface and can print themselves when passed to fmt.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 a Cause 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 with errors.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 to StackTrace() 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.