]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/module: in VersionError, do not wrap an existing ModuleError
authorBryan C. Mills <bcmills@google.com>
Fri, 9 Aug 2019 21:31:23 +0000 (17:31 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 12 Sep 2019 14:08:16 +0000 (14:08 +0000)
commit3d522b10885a21f2c07344748e36bbfdcad01990
tree556f65ff03d854047c8d5b30b599eb45d58d8ba7
parent1581bb9843815b3393779b28f7c501e2052486ce
cmd/go/internal/module: in VersionError, do not wrap an existing ModuleError

VersionError wraps the given error in a ModuleError struct.

If the given error is already a ModuleError for the same path and
version, we now return it directly instead of wrapping.
This makes it safer to call VersionError if we don't know whether
a given error is already wrapped.

Updates #30748

Change-Id: I41b23f6c3ead0ec382e848696da51f478da1ad35
Reviewed-on: https://go-review.googlesource.com/c/go/+/189781
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/module/module.go