pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/go-errors Update to 0.8.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c424003689e4
branches:  trunk
changeset: 325421:c424003689e4
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Sun Nov 18 07:29:52 2018 +0000

description:
Update to 0.8.0

Changelog:
0.8.0:
What's new since version 0.7.1

errors 0.8.0 decomposes Wrap (and Wrapf) into their component operations, namely adding a message to an error, and adding a stack trace to an error, which were previously merged into a single 
operation.

This is accomplished by adding two top level functions, errors.WithMessage and errors.WithStack, and rewriting Wrap and Wrapf in terms of these operations.

The motivation for this change was need to treat each of the following operations as distinct:

    Adding a context message to an existing error without altering the stack trace.
    Adding a stack trace to an existing error without the requirement of adding an additional message.
    Retrieving the immediate cause of an error; popping one element of the error stack.

The addition of WithStack and WithMessage increases the surface area of this package by two methods, after long discussions at GopherCon 2016 it was felt strongly that destructuring the operation of 
Wrap and Wrapf was necessary.

For the moment Wrap and Wrapf remain, but depending on your feedback may be deprecated in future releases. Please leave comments via the issue link.

Thanks to @nmiyake and @fabstu for their assistance in preparing this release.
Bug fixes

    Add Go 1.7.1 to .travis.yml. Thanks @Thomasdezeeuw

0.7.1:
What's new since version 0.7.0

0.7.1 is a minor release in the 0.7 series which contains bugfixes, documentation improvements and cleanups and some internal refactoring.
Improvements

    Rename StackTrace interface to stacktracer in docs and examples.
    Capitalise first letter of trace in examples. Thanks @jongillham
    Wrapped errors now print full stacktrace.
    Documentation improvements, #69. Thanks @AlekSi
    Added benchmarks comparing stack trace performance. Fixes #72. Thanks @kardianos

Bug fixes

    Fix %q format for wrapped errors. Thanks @greensnark
    Remove trailing newline from LICENSE file. Thanks @vbatts
    Tests now pass when pkg/errors is vendored. Fixes #77. Thanks @exp
    Fix the %q format for errors so it puts "" around the output (caused by a bug introduced between 0.7.0 and 0.7.1). Thanks @ncw

0.7.0:
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.

diffstat:

 devel/go-errors/Makefile |   5 ++---
 devel/go-errors/PLIST    |   5 +++--
 devel/go-errors/distinfo |  10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diffs (47 lines):

diff -r 504a2315a75f -r c424003689e4 devel/go-errors/Makefile
--- a/devel/go-errors/Makefile  Sun Nov 18 07:22:08 2018 +0000
+++ b/devel/go-errors/Makefile  Sun Nov 18 07:29:52 2018 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2018/11/04 18:37:59 bsiegert Exp $
+# $NetBSD: Makefile,v 1.7 2018/11/18 07:29:52 ryoon Exp $
 
-DISTNAME=      errors-0.6.0
+DISTNAME=      errors-0.8.0
 PKGNAME=       go-${DISTNAME}
-PKGREVISION=   4
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=pkg/}
 CATEGORIES=    devel
 GITHUB_TAG=    v${PKGVERSION_NOREV}
diff -r 504a2315a75f -r c424003689e4 devel/go-errors/PLIST
--- a/devel/go-errors/PLIST     Sun Nov 18 07:22:08 2018 +0000
+++ b/devel/go-errors/PLIST     Sun Nov 18 07:29:52 2018 +0000
@@ -1,11 +1,12 @@
-@comment $NetBSD: PLIST,v 1.1 2017/08/17 01:23:10 gavan Exp $
+@comment $NetBSD: PLIST,v 1.2 2018/11/18 07:29:52 ryoon Exp $
 gopkg/pkg/${GO_PLATFORM}/github.com/pkg/errors.a
 gopkg/src/github.com/pkg/errors/LICENSE
 gopkg/src/github.com/pkg/errors/README.md
 gopkg/src/github.com/pkg/errors/appveyor.yml
+gopkg/src/github.com/pkg/errors/bench_test.go
 gopkg/src/github.com/pkg/errors/errors.go
 gopkg/src/github.com/pkg/errors/errors_test.go
 gopkg/src/github.com/pkg/errors/example_test.go
+gopkg/src/github.com/pkg/errors/format_test.go
 gopkg/src/github.com/pkg/errors/stack.go
 gopkg/src/github.com/pkg/errors/stack_test.go
-@pkgdir bin
diff -r 504a2315a75f -r c424003689e4 devel/go-errors/distinfo
--- a/devel/go-errors/distinfo  Sun Nov 18 07:22:08 2018 +0000
+++ b/devel/go-errors/distinfo  Sun Nov 18 07:29:52 2018 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.1 2017/08/17 01:23:10 gavan Exp $
+$NetBSD: distinfo,v 1.2 2018/11/18 07:29:52 ryoon Exp $
 
-SHA1 (errors-0.6.0.tar.gz) = 1cdcb7955c31269164c1e23f697c72d149b761bc
-RMD160 (errors-0.6.0.tar.gz) = a46a88c12490c1295aff9a981756dccb908fa309
-SHA512 (errors-0.6.0.tar.gz) = bc60e598230c36bd3b81a311c31736ac59a0e88ae2952501422df46437bc35349119fd57df7f0e0d0e39300af7d6d794b3bf5298499729531946499f64643718
-Size (errors-0.6.0.tar.gz) = 7853 bytes
+SHA1 (errors-0.8.0.tar.gz) = 6256e89cb3c94189180096eb804d9c8c90088fb5
+RMD160 (errors-0.8.0.tar.gz) = 473ecf6cada7287f2e27c90509d351f98895ecf3
+SHA512 (errors-0.8.0.tar.gz) = 82055b10c02f13a8ce497388729568ddde7ae61e9fb2592b9acb11c61dfe94d5554432aee168e7c7adbd8345511c3e4ce0ba4c1b23cf253480e199a95316c443
+Size (errors-0.8.0.tar.gz) = 11344 bytes



Home | Main Index | Thread Index | Old Index