Ver Fonte

vendor: gotest.tools v3.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn há 4 anos atrás
pai
commit
3e1e9e878c
28 ficheiros alterados com 140 adições e 92 exclusões
  1. 1 1
      libnetwork/datastore/datastore_test.go
  2. 2 2
      libnetwork/drivers/overlay/ovmanager/ovmanager_test.go
  3. 2 2
      libnetwork/drvregistry/drvregistry_test.go
  4. 1 1
      libnetwork/firewall_test.go
  5. 2 2
      libnetwork/ipam/allocator_test.go
  6. 2 2
      libnetwork/ipam/parallel_test.go
  7. 2 2
      libnetwork/ipamutils/utils_test.go
  8. 3 3
      libnetwork/networkdb/networkdb_test.go
  9. 2 2
      libnetwork/osl/kernel/knobs_linux_test.go
  10. 2 2
      libnetwork/service_common_test.go
  11. 2 2
      libnetwork/types/types_test.go
  12. 1 1
      libnetwork/vendor.conf
  13. 0 8
      libnetwork/vendor/gotest.tools/go.mod
  14. 0 0
      libnetwork/vendor/gotest.tools/v3/LICENSE
  15. 23 8
      libnetwork/vendor/gotest.tools/v3/README.md
  16. 46 28
      libnetwork/vendor/gotest.tools/v3/assert/assert.go
  17. 22 13
      libnetwork/vendor/gotest.tools/v3/assert/cmp/compare.go
  18. 1 1
      libnetwork/vendor/gotest.tools/v3/assert/cmp/result.go
  19. 3 3
      libnetwork/vendor/gotest.tools/v3/assert/result.go
  20. 10 0
      libnetwork/vendor/gotest.tools/v3/go.mod
  21. 0 0
      libnetwork/vendor/gotest.tools/v3/internal/difflib/LICENSE
  22. 1 1
      libnetwork/vendor/gotest.tools/v3/internal/difflib/difflib.go
  23. 1 1
      libnetwork/vendor/gotest.tools/v3/internal/format/diff.go
  24. 1 1
      libnetwork/vendor/gotest.tools/v3/internal/format/format.go
  25. 0 0
      libnetwork/vendor/gotest.tools/v3/internal/source/defers.go
  26. 9 5
      libnetwork/vendor/gotest.tools/v3/internal/source/source.go
  27. 0 0
      libnetwork/vendor/gotest.tools/v3/poll/check.go
  28. 1 1
      libnetwork/vendor/gotest.tools/v3/poll/poll.go

+ 1 - 1
libnetwork/datastore/datastore_test.go

@@ -7,7 +7,7 @@ import (
 
 
 	"github.com/docker/libnetwork/options"
 	"github.com/docker/libnetwork/options"
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"
-	"gotest.tools/assert"
+	"gotest.tools/v3/assert"
 )
 )
 
 
 var dummyKey = "dummy"
 var dummyKey = "dummy"

+ 2 - 2
libnetwork/drivers/overlay/ovmanager/ovmanager_test.go

@@ -11,8 +11,8 @@ import (
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/netlabel"
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"
 	"github.com/docker/libnetwork/types"
 	"github.com/docker/libnetwork/types"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 )
 
 
 func newDriver(t *testing.T) *driver {
 func newDriver(t *testing.T) *driver {

+ 2 - 2
libnetwork/drvregistry/drvregistry_test.go

@@ -11,8 +11,8 @@ import (
 	builtinIpam "github.com/docker/libnetwork/ipams/builtin"
 	builtinIpam "github.com/docker/libnetwork/ipams/builtin"
 	nullIpam "github.com/docker/libnetwork/ipams/null"
 	nullIpam "github.com/docker/libnetwork/ipams/null"
 	remoteIpam "github.com/docker/libnetwork/ipams/remote"
 	remoteIpam "github.com/docker/libnetwork/ipams/remote"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 
 
 	// this takes care of the incontainer flag
 	// this takes care of the incontainer flag
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"

+ 1 - 1
libnetwork/firewall_test.go

@@ -8,7 +8,7 @@ import (
 	"github.com/docker/libnetwork/iptables"
 	"github.com/docker/libnetwork/iptables"
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/netlabel"
 	"github.com/docker/libnetwork/options"
 	"github.com/docker/libnetwork/options"
-	"gotest.tools/assert"
+	"gotest.tools/v3/assert"
 )
 )
 
 
 const (
 const (

+ 2 - 2
libnetwork/ipam/allocator_test.go

@@ -19,8 +19,8 @@ import (
 	"github.com/docker/libnetwork/ipamapi"
 	"github.com/docker/libnetwork/ipamapi"
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"
 	"github.com/docker/libnetwork/types"
 	"github.com/docker/libnetwork/types"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 )
 
 
 const (
 const (

+ 2 - 2
libnetwork/ipam/parallel_test.go

@@ -13,8 +13,8 @@ import (
 
 
 	"github.com/docker/libnetwork/ipamapi"
 	"github.com/docker/libnetwork/ipamapi"
 	"golang.org/x/sync/semaphore"
 	"golang.org/x/sync/semaphore"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 )
 
 
 const (
 const (

+ 2 - 2
libnetwork/ipamutils/utils_test.go

@@ -5,8 +5,8 @@ import (
 	"testing"
 	"testing"
 
 
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 )
 
 
 func initBroadPredefinedNetworks() []*net.IPNet {
 func initBroadPredefinedNetworks() []*net.IPNet {

+ 3 - 3
libnetwork/networkdb/networkdb_test.go

@@ -15,9 +15,9 @@ import (
 	"github.com/docker/go-events"
 	"github.com/docker/go-events"
 	"github.com/hashicorp/memberlist"
 	"github.com/hashicorp/memberlist"
 	"github.com/sirupsen/logrus"
 	"github.com/sirupsen/logrus"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
-	"gotest.tools/poll"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
+	"gotest.tools/v3/poll"
 
 
 	// this takes care of the incontainer flag
 	// this takes care of the incontainer flag
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"

+ 2 - 2
libnetwork/osl/kernel/knobs_linux_test.go

@@ -4,8 +4,8 @@ import (
 	"testing"
 	"testing"
 
 
 	"github.com/sirupsen/logrus"
 	"github.com/sirupsen/logrus"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 
 
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"
 )
 )

+ 2 - 2
libnetwork/service_common_test.go

@@ -5,8 +5,8 @@ import (
 	"testing"
 	"testing"
 
 
 	"github.com/docker/libnetwork/resolvconf"
 	"github.com/docker/libnetwork/resolvconf"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 )
 
 
 func TestCleanupServiceDiscovery(t *testing.T) {
 func TestCleanupServiceDiscovery(t *testing.T) {

+ 2 - 2
libnetwork/types/types_test.go

@@ -5,8 +5,8 @@ import (
 	"testing"
 	"testing"
 
 
 	_ "github.com/docker/libnetwork/testutils"
 	_ "github.com/docker/libnetwork/testutils"
-	"gotest.tools/assert"
-	is "gotest.tools/assert/cmp"
+	"gotest.tools/v3/assert"
+	is "gotest.tools/v3/assert/cmp"
 )
 )
 
 
 func TestTransportPortConv(t *testing.T) {
 func TestTransportPortConv(t *testing.T) {

+ 1 - 1
libnetwork/vendor.conf

@@ -50,7 +50,7 @@ github.com/pkg/errors                               614d223910a179a466c1767a9854
 github.com/ishidawataru/sctp                        6e2cb1366111dcf547c13531e3a263a067715847
 github.com/ishidawataru/sctp                        6e2cb1366111dcf547c13531e3a263a067715847
 go.opencensus.io                                    9c377598961b706d1542bd2d84d538b5094d596e # v0.22.0
 go.opencensus.io                                    9c377598961b706d1542bd2d84d538b5094d596e # v0.22.0
 
 
-gotest.tools                                        1083505acf35a0bd8a696b26837e1fb3187a7a83 # v2.3.0
+gotest.tools/v3                                     bb0d8a963040ea5048dcef1a14d8f8b58a33d4b3 # v3.0.2
 github.com/google/go-cmp                            3af367b6b30c263d47e8895973edcca9a49cf029 # v0.2.0
 github.com/google/go-cmp                            3af367b6b30c263d47e8895973edcca9a49cf029 # v0.2.0
 
 
 github.com/moby/ipvs                                4566ccea0e08d68e9614c3e7a64a23b850c4bb35 # v1.0.1
 github.com/moby/ipvs                                4566ccea0e08d68e9614c3e7a64a23b850c4bb35 # v1.0.1

+ 0 - 8
libnetwork/vendor/gotest.tools/go.mod

@@ -1,8 +0,0 @@
-module gotest.tools
-
-require (
-	github.com/google/go-cmp v0.2.0
-	github.com/pkg/errors v0.8.0
-	github.com/spf13/pflag v1.0.3
-	golang.org/x/tools v0.0.0-20180810170437-e96c4e24768d
-)

+ 0 - 0
libnetwork/vendor/gotest.tools/LICENSE → libnetwork/vendor/gotest.tools/v3/LICENSE


+ 23 - 8
libnetwork/vendor/gotest.tools/README.md → libnetwork/vendor/gotest.tools/v3/README.md

@@ -2,26 +2,41 @@
 
 
 A collection of packages to augment `testing` and support common patterns.
 A collection of packages to augment `testing` and support common patterns.
 
 
-[![GoDoc](https://godoc.org/gotest.tools?status.svg)](https://godoc.org/gotest.tools)
+[![GoDoc](https://godoc.org/gotest.tools?status.svg)](http://gotest.tools)
 [![CircleCI](https://circleci.com/gh/gotestyourself/gotest.tools/tree/master.svg?style=shield)](https://circleci.com/gh/gotestyourself/gotest.tools/tree/master)
 [![CircleCI](https://circleci.com/gh/gotestyourself/gotest.tools/tree/master.svg?style=shield)](https://circleci.com/gh/gotestyourself/gotest.tools/tree/master)
 [![Go Reportcard](https://goreportcard.com/badge/gotest.tools)](https://goreportcard.com/report/gotest.tools)
 [![Go Reportcard](https://goreportcard.com/badge/gotest.tools)](https://goreportcard.com/report/gotest.tools)
 
 
+## Usage
+
+With Go modules enabled (go1.11+)
+
+```
+$ go get gotest.tools/v3
+```
+
+```
+import "gotest.tools/v3/assert"
+```
+
+To use `gotest.tools` with an older version of Go that does not understand Go
+module paths pin to version `v2.3.0`.
+
 
 
 ## Packages
 ## Packages
 
 
-* [assert](http://godoc.org/gotest.tools/assert) -
+* [assert](http://gotest.tools/assert) -
   compare values and fail the test when a comparison fails
   compare values and fail the test when a comparison fails
-* [env](http://godoc.org/gotest.tools/env) -
+* [env](http://gotest.tools/env) -
   test code which uses environment variables
   test code which uses environment variables
-* [fs](http://godoc.org/gotest.tools/fs) -
+* [fs](http://gotest.tools/fs) -
   create temporary files and compare a filesystem tree to an expected value
   create temporary files and compare a filesystem tree to an expected value
-* [golden](http://godoc.org/gotest.tools/golden) -
+* [golden](http://gotest.tools/golden) -
   compare large multi-line strings against values frozen in golden files
   compare large multi-line strings against values frozen in golden files
-* [icmd](http://godoc.org/gotest.tools/icmd) -
+* [icmd](http://gotest.tools/icmd) -
   execute binaries and test the output
   execute binaries and test the output
-* [poll](http://godoc.org/gotest.tools/poll) -
+* [poll](http://gotest.tools/poll) -
   test asynchronous code by polling until a desired state is reached
   test asynchronous code by polling until a desired state is reached
-* [skip](http://godoc.org/gotest.tools/skip) -
+* [skip](http://gotest.tools/skip) -
   skip a test and print the source code of the condition used to skip the test
   skip a test and print the source code of the condition used to skip the test
 
 
 ## Related
 ## Related

+ 46 - 28
libnetwork/vendor/gotest.tools/assert/assert.go → libnetwork/vendor/gotest.tools/v3/assert/assert.go

@@ -49,30 +49,31 @@ The example below shows assert used with some common types.
 
 
 Comparisons
 Comparisons
 
 
-Package https://godoc.org/gotest.tools/assert/cmp provides
+Package http://gotest.tools/assert/cmp provides
 many common comparisons. Additional comparisons can be written to compare
 many common comparisons. Additional comparisons can be written to compare
 values in other ways. See the example Assert (CustomComparison).
 values in other ways. See the example Assert (CustomComparison).
 
 
 Automated migration from testify
 Automated migration from testify
 
 
-gty-migrate-from-testify is a binary which can update source code which uses
-testify assertions to use the assertions provided by this package.
+gty-migrate-from-testify is a command which translates Go source code from
+testify assertions to the assertions provided by this package.
 
 
-See http://bit.do/cmd-gty-migrate-from-testify.
+See http://gotest.tools/assert/cmd/gty-migrate-from-testify.
 
 
 
 
 */
 */
-package assert // import "gotest.tools/assert"
+package assert // import "gotest.tools/v3/assert"
 
 
 import (
 import (
 	"fmt"
 	"fmt"
 	"go/ast"
 	"go/ast"
 	"go/token"
 	"go/token"
+	"reflect"
 
 
 	gocmp "github.com/google/go-cmp/cmp"
 	gocmp "github.com/google/go-cmp/cmp"
-	"gotest.tools/assert/cmp"
-	"gotest.tools/internal/format"
-	"gotest.tools/internal/source"
+	"gotest.tools/v3/assert/cmp"
+	"gotest.tools/v3/internal/format"
+	"gotest.tools/v3/internal/source"
 )
 )
 
 
 // BoolOrComparison can be a bool, or cmp.Comparison. See Assert() for usage.
 // BoolOrComparison can be a bool, or cmp.Comparison. See Assert() for usage.
@@ -118,8 +119,8 @@ func assert(
 		return true
 		return true
 
 
 	case error:
 	case error:
-		msg := "error is not nil: "
-		t.Log(format.WithCustomMessage(failureMessage+msg+check.Error(), msgAndArgs...))
+		msg := failureMsgFromError(check)
+		t.Log(format.WithCustomMessage(failureMessage+msg, msgAndArgs...))
 
 
 	case cmp.Comparison:
 	case cmp.Comparison:
 		success = runComparison(t, argSelector, check, msgAndArgs...)
 		success = runComparison(t, argSelector, check, msgAndArgs...)
@@ -174,6 +175,15 @@ func logFailureFromBool(t TestingT, msgAndArgs ...interface{}) {
 	t.Log(format.WithCustomMessage(failureMessage+msg, msgAndArgs...))
 	t.Log(format.WithCustomMessage(failureMessage+msg, msgAndArgs...))
 }
 }
 
 
+func failureMsgFromError(err error) string {
+	// Handle errors with non-nil types
+	v := reflect.ValueOf(err)
+	if v.Kind() == reflect.Ptr && v.IsNil() {
+		return fmt.Sprintf("error is not nil: error has type %T", err)
+	}
+	return "error is not nil: " + err.Error()
+}
+
 func boolFailureMessage(expr ast.Expr) (string, error) {
 func boolFailureMessage(expr ast.Expr) (string, error) {
 	if binaryExpr, ok := expr.(*ast.BinaryExpr); ok && binaryExpr.Op == token.NEQ {
 	if binaryExpr, ok := expr.(*ast.BinaryExpr); ok && binaryExpr.Op == token.NEQ {
 		x, err := source.FormatNode(binaryExpr.X)
 		x, err := source.FormatNode(binaryExpr.X)
@@ -202,17 +212,20 @@ func boolFailureMessage(expr ast.Expr) (string, error) {
 	return "expression is false: " + formatted, nil
 	return "expression is false: " + formatted, nil
 }
 }
 
 
-// Assert performs a comparison. If the comparison fails the test is marked as
+// Assert performs a comparison. If the comparison fails, the test is marked as
 // failed, a failure message is logged, and execution is stopped immediately.
 // failed, a failure message is logged, and execution is stopped immediately.
 //
 //
-// The comparison argument may be one of three types: bool, cmp.Comparison or
-// error.
-// When called with a bool the failure message will contain the literal source
-// code of the expression.
-// When called with a cmp.Comparison the comparison is responsible for producing
-// a helpful failure message.
-// When called with an error a nil value is considered success. A non-nil error
-// is a failure, and Error() is used as the failure message.
+// The comparison argument may be one of three types:
+//   bool
+// True is success. False is a failure.
+// The failure message will contain the literal source code of the expression.
+//   cmp.Comparison
+// Uses cmp.Result.Success() to check for success of failure.
+// The comparison is responsible for producing a helpful failure message.
+// http://gotest.tools/assert/cmp provides many common comparisons.
+//   error
+// A nil value is considered success.
+// A non-nil error is a failure, err.Error() is used as the failure message.
 func Assert(t TestingT, comparison BoolOrComparison, msgAndArgs ...interface{}) {
 func Assert(t TestingT, comparison BoolOrComparison, msgAndArgs ...interface{}) {
 	if ht, ok := t.(helperT); ok {
 	if ht, ok := t.(helperT); ok {
 		ht.Helper()
 		ht.Helper()
@@ -260,10 +273,10 @@ func Equal(t TestingT, x, y interface{}, msgAndArgs ...interface{}) {
 	assert(t, t.FailNow, argsAfterT, cmp.Equal(x, y), msgAndArgs...)
 	assert(t, t.FailNow, argsAfterT, cmp.Equal(x, y), msgAndArgs...)
 }
 }
 
 
-// DeepEqual uses google/go-cmp (http://bit.do/go-cmp) to assert two values are
-// equal and fails the test if they are not equal.
+// DeepEqual uses google/go-cmp (https://godoc.org/github.com/google/go-cmp/cmp)
+// to assert two values are equal and fails the test if they are not equal.
 //
 //
-// Package https://godoc.org/gotest.tools/assert/opt provides some additional
+// Package http://gotest.tools/assert/opt provides some additional
 // commonly used Options.
 // commonly used Options.
 //
 //
 // This is equivalent to Assert(t, cmp.DeepEqual(x, y)).
 // This is equivalent to Assert(t, cmp.DeepEqual(x, y)).
@@ -295,14 +308,19 @@ func ErrorContains(t TestingT, err error, substring string, msgAndArgs ...interf
 }
 }
 
 
 // ErrorType fails the test if err is nil, or err is not the expected type.
 // ErrorType fails the test if err is nil, or err is not the expected type.
+// Equivalent to Assert(t, cmp.ErrorType(err, expected)).
 //
 //
 // Expected can be one of:
 // Expected can be one of:
-// a func(error) bool which returns true if the error is the expected type,
-// an instance of (or a pointer to) a struct of the expected type,
-// a pointer to an interface the error is expected to implement,
-// a reflect.Type of the expected struct or interface.
-//
-// Equivalent to Assert(t, cmp.ErrorType(err, expected)).
+//   func(error) bool
+// Function should return true if the error is the expected type.
+//   type struct{}, type &struct{}
+// A struct or a pointer to a struct.
+// Fails if the error is not of the same type as expected.
+//   type &interface{}
+// A pointer to an interface type.
+// Fails if err does not implement the interface.
+//   reflect.Type
+// Fails if err does not implement the reflect.Type
 func ErrorType(t TestingT, err error, expected interface{}, msgAndArgs ...interface{}) {
 func ErrorType(t TestingT, err error, expected interface{}, msgAndArgs ...interface{}) {
 	if ht, ok := t.(helperT); ok {
 	if ht, ok := t.(helperT); ok {
 		ht.Helper()
 		ht.Helper()

+ 22 - 13
libnetwork/vendor/gotest.tools/assert/cmp/compare.go → libnetwork/vendor/gotest.tools/v3/assert/cmp/compare.go

@@ -1,5 +1,5 @@
 /*Package cmp provides Comparisons for Assert and Check*/
 /*Package cmp provides Comparisons for Assert and Check*/
-package cmp // import "gotest.tools/assert/cmp"
+package cmp // import "gotest.tools/v3/assert/cmp"
 
 
 import (
 import (
 	"fmt"
 	"fmt"
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"strings"
 
 
 	"github.com/google/go-cmp/cmp"
 	"github.com/google/go-cmp/cmp"
-	"gotest.tools/internal/format"
+	"gotest.tools/v3/internal/format"
 )
 )
 
 
 // Comparison is a function which compares values and returns ResultSuccess if
 // Comparison is a function which compares values and returns ResultSuccess if
@@ -16,11 +16,12 @@ import (
 // Result will contain a message about why it failed.
 // Result will contain a message about why it failed.
 type Comparison func() Result
 type Comparison func() Result
 
 
-// DeepEqual compares two values using google/go-cmp (http://bit.do/go-cmp)
+// DeepEqual compares two values using google/go-cmp
+// (https://godoc.org/github.com/google/go-cmp/cmp)
 // and succeeds if the values are equal.
 // and succeeds if the values are equal.
 //
 //
 // The comparison can be customized using comparison Options.
 // The comparison can be customized using comparison Options.
-// Package https://godoc.org/gotest.tools/assert/opt provides some additional
+// Package http://gotest.tools/assert/opt provides some additional
 // commonly used Options.
 // commonly used Options.
 func DeepEqual(x, y interface{}, opts ...cmp.Option) Comparison {
 func DeepEqual(x, y interface{}, opts ...cmp.Option) Comparison {
 	return func() (result Result) {
 	return func() (result Result) {
@@ -103,10 +104,10 @@ func Equal(x, y interface{}) Comparison {
 			return multiLineDiffResult(diff)
 			return multiLineDiffResult(diff)
 		}
 		}
 		return ResultFailureTemplate(`
 		return ResultFailureTemplate(`
-			{{- .Data.x}} (
+			{{- printf "%v" .Data.x}} (
 				{{- with callArg 0 }}{{ formatNode . }} {{end -}}
 				{{- with callArg 0 }}{{ formatNode . }} {{end -}}
 				{{- printf "%T" .Data.x -}}
 				{{- printf "%T" .Data.x -}}
-			) != {{ .Data.y}} (
+			) != {{ printf "%v" .Data.y}} (
 				{{- with callArg 1 }}{{ formatNode . }} {{end -}}
 				{{- with callArg 1 }}{{ formatNode . }} {{end -}}
 				{{- printf "%T" .Data.y -}}
 				{{- printf "%T" .Data.y -}}
 			)`,
 			)`,
@@ -241,10 +242,12 @@ func ErrorContains(err error, substring string) Comparison {
 	}
 	}
 }
 }
 
 
+type causer interface {
+	Cause() error
+}
+
 func formatErrorMessage(err error) string {
 func formatErrorMessage(err error) string {
-	if _, ok := err.(interface {
-		Cause() error
-	}); ok {
+	if _, ok := err.(causer); ok {
 		return fmt.Sprintf("%q\n%+v", err, err)
 		return fmt.Sprintf("%q\n%+v", err, err)
 	}
 	}
 	// This error was not wrapped with github.com/pkg/errors
 	// This error was not wrapped with github.com/pkg/errors
@@ -283,10 +286,16 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison {
 // ErrorType succeeds if err is not nil and is of the expected type.
 // ErrorType succeeds if err is not nil and is of the expected type.
 //
 //
 // Expected can be one of:
 // Expected can be one of:
-// a func(error) bool which returns true if the error is the expected type,
-// an instance of (or a pointer to) a struct of the expected type,
-// a pointer to an interface the error is expected to implement,
-// a reflect.Type of the expected struct or interface.
+//   func(error) bool
+// Function should return true if the error is the expected type.
+//   type struct{}, type &struct{}
+// A struct or a pointer to a struct.
+// Fails if the error is not of the same type as expected.
+//   type &interface{}
+// A pointer to an interface type.
+// Fails if err does not implement the interface.
+//   reflect.Type
+// Fails if err does not implement the reflect.Type
 func ErrorType(err error, expected interface{}) Comparison {
 func ErrorType(err error, expected interface{}) Comparison {
 	return func() Result {
 	return func() Result {
 		switch expectedType := expected.(type) {
 		switch expectedType := expected.(type) {

+ 1 - 1
libnetwork/vendor/gotest.tools/assert/cmp/result.go → libnetwork/vendor/gotest.tools/v3/assert/cmp/result.go

@@ -6,7 +6,7 @@ import (
 	"go/ast"
 	"go/ast"
 	"text/template"
 	"text/template"
 
 
-	"gotest.tools/internal/source"
+	"gotest.tools/v3/internal/source"
 )
 )
 
 
 // A Result of a Comparison.
 // A Result of a Comparison.

+ 3 - 3
libnetwork/vendor/gotest.tools/assert/result.go → libnetwork/vendor/gotest.tools/v3/assert/result.go

@@ -4,9 +4,9 @@ import (
 	"fmt"
 	"fmt"
 	"go/ast"
 	"go/ast"
 
 
-	"gotest.tools/assert/cmp"
-	"gotest.tools/internal/format"
-	"gotest.tools/internal/source"
+	"gotest.tools/v3/assert/cmp"
+	"gotest.tools/v3/internal/format"
+	"gotest.tools/v3/internal/source"
 )
 )
 
 
 func runComparison(
 func runComparison(

+ 10 - 0
libnetwork/vendor/gotest.tools/v3/go.mod

@@ -0,0 +1,10 @@
+module gotest.tools/v3
+
+require (
+	github.com/google/go-cmp v0.3.0
+	github.com/pkg/errors v0.8.1
+	github.com/spf13/pflag v1.0.3
+	golang.org/x/tools v0.0.0-20190624222133-a101b041ded4
+)
+
+go 1.11

+ 0 - 0
libnetwork/vendor/gotest.tools/internal/difflib/LICENSE → libnetwork/vendor/gotest.tools/v3/internal/difflib/LICENSE


+ 1 - 1
libnetwork/vendor/gotest.tools/internal/difflib/difflib.go → libnetwork/vendor/gotest.tools/v3/internal/difflib/difflib.go

@@ -4,7 +4,7 @@ Original source: https://github.com/pmezard/go-difflib
 
 
 This file is trimmed to only the parts used by this repository.
 This file is trimmed to only the parts used by this repository.
 */
 */
-package difflib // import "gotest.tools/internal/difflib"
+package difflib // import "gotest.tools/v3/internal/difflib"
 
 
 func min(a, b int) int {
 func min(a, b int) int {
 	if a < b {
 	if a < b {

+ 1 - 1
libnetwork/vendor/gotest.tools/internal/format/diff.go → libnetwork/vendor/gotest.tools/v3/internal/format/diff.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 	"strings"
 	"unicode"
 	"unicode"
 
 
-	"gotest.tools/internal/difflib"
+	"gotest.tools/v3/internal/difflib"
 )
 )
 
 
 const (
 const (

+ 1 - 1
libnetwork/vendor/gotest.tools/internal/format/format.go → libnetwork/vendor/gotest.tools/v3/internal/format/format.go

@@ -1,4 +1,4 @@
-package format // import "gotest.tools/internal/format"
+package format // import "gotest.tools/v3/internal/format"
 
 
 import "fmt"
 import "fmt"
 
 

+ 0 - 0
libnetwork/vendor/gotest.tools/internal/source/defers.go → libnetwork/vendor/gotest.tools/v3/internal/source/defers.go


+ 9 - 5
libnetwork/vendor/gotest.tools/internal/source/source.go → libnetwork/vendor/gotest.tools/v3/internal/source/source.go

@@ -1,4 +1,4 @@
-package source // import "gotest.tools/internal/source"
+package source // import "gotest.tools/v3/internal/source"
 
 
 import (
 import (
 	"bytes"
 	"bytes"
@@ -92,7 +92,9 @@ func nodePosition(fileset *token.FileSet, node ast.Node) token.Position {
 	return fileset.Position(node.Pos())
 	return fileset.Position(node.Pos())
 }
 }
 
 
-var goVersionBefore19 = func() bool {
+// GoVersionLessThan returns true if runtime.Version() is semantically less than
+// version 1.minor.
+func GoVersionLessThan(minor int64) bool {
 	version := runtime.Version()
 	version := runtime.Version()
 	// not a release version
 	// not a release version
 	if !strings.HasPrefix(version, "go") {
 	if !strings.HasPrefix(version, "go") {
@@ -103,9 +105,11 @@ var goVersionBefore19 = func() bool {
 	if len(parts) < 2 {
 	if len(parts) < 2 {
 		return false
 		return false
 	}
 	}
-	minor, err := strconv.ParseInt(parts[1], 10, 32)
-	return err == nil && parts[0] == "1" && minor < 9
-}()
+	actual, err := strconv.ParseInt(parts[1], 10, 32)
+	return err == nil && parts[0] == "1" && actual < minor
+}
+
+var goVersionBefore19 = GoVersionLessThan(9)
 
 
 func getCallExprArgs(node ast.Node) ([]ast.Expr, error) {
 func getCallExprArgs(node ast.Node) ([]ast.Expr, error) {
 	visitor := &callExprVisitor{}
 	visitor := &callExprVisitor{}

+ 0 - 0
libnetwork/vendor/gotest.tools/poll/check.go → libnetwork/vendor/gotest.tools/v3/poll/check.go


+ 1 - 1
libnetwork/vendor/gotest.tools/poll/poll.go → libnetwork/vendor/gotest.tools/v3/poll/poll.go

@@ -1,6 +1,6 @@
 /*Package poll provides tools for testing asynchronous code.
 /*Package poll provides tools for testing asynchronous code.
  */
  */
-package poll // import "gotest.tools/poll"
+package poll // import "gotest.tools/v3/poll"
 
 
 import (
 import (
 	"fmt"
 	"fmt"