From 2e83f568569ac88b5cbaaffe71876d6946647f43 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 29 Apr 2020 11:42:32 +0200 Subject: [PATCH] vendor: update gotest.tools v3.0.2 full diff: https://github.com/gotestyourself/gotest.tools/compare/v3.0.1...v3.0.2 Signed-off-by: Sebastiaan van Stijn --- vendor.conf | 2 +- vendor/gotest.tools/v3/assert/assert.go | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/vendor.conf b/vendor.conf index 074ac65d49..0a834fe19a 100755 --- a/vendor.conf +++ b/vendor.conf @@ -85,7 +85,7 @@ google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6 google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1 gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1 gopkg.in/yaml.v2 53403b58ad1b561927d19068c655246f2db79d48 # v2.2.8 -gotest.tools/v3 ab4a870b92ce57a83881fbeb535a137a20d664b7 # v3.0.1 +gotest.tools/v3 bb0d8a963040ea5048dcef1a14d8f8b58a33d4b3 # v3.0.2 k8s.io/api 35e20aa79eb876d1014e0383c7fcda49e52c5d76 # kubernetes-1.16.1 k8s.io/apimachinery 27d36303b6556f377b4f34e64705fa9024a12b0c # kubernetes-1.16.1 k8s.io/apiextensions-apiserver 49e3d608220c016ce72a3bd9524eed4dcef587df # kubernetes-1.16.1 diff --git a/vendor/gotest.tools/v3/assert/assert.go b/vendor/gotest.tools/v3/assert/assert.go index 83610aa852..e75d1f38a0 100644 --- a/vendor/gotest.tools/v3/assert/assert.go +++ b/vendor/gotest.tools/v3/assert/assert.go @@ -119,12 +119,8 @@ func assert( return true case error: - // Handle nil structs which implement error as a nil error - if reflect.ValueOf(check).IsNil() { - return true - } - 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: success = runComparison(t, argSelector, check, msgAndArgs...) @@ -179,6 +175,15 @@ func logFailureFromBool(t TestingT, msgAndArgs ...interface{}) { 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) { if binaryExpr, ok := expr.(*ast.BinaryExpr); ok && binaryExpr.Op == token.NEQ { x, err := source.FormatNode(binaryExpr.X)