From 0ebd9cfb16534a24e03cff6609b7d121a75041ff Mon Sep 17 00:00:00 2001 From: Matthew Sykes Date: Mon, 15 Mar 2021 17:55:27 -0400 Subject: [PATCH] platform/golang: loosen assertion for Go 1.16.2 (#2480) The error messages for commands executed outside of a module were changed in Go 1.16.2. This change loosens our assertion to handle the old and new messages. Signed-off-by: Matthew Sykes Signed-off-by: David Enyeart --- core/chaincode/platforms/golang/list_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/chaincode/platforms/golang/list_test.go b/core/chaincode/platforms/golang/list_test.go index 5ea0cfbbbca..a76c9d26c39 100644 --- a/core/chaincode/platforms/golang/list_test.go +++ b/core/chaincode/platforms/golang/list_test.go @@ -122,5 +122,6 @@ func Test_listModuleInfoFailure(t *testing.T) { require.NoError(t, err, "failed to change to temporary directory") _, err = listModuleInfo() - require.EqualError(t, err, "'go list' failed with: go: cannot find main module; see 'go help modules': exit status 1") + require.ErrorContains(t, err, "'go list' failed with: go: ") + require.ErrorContains(t, err, "see 'go help modules': exit status 1") }