From e6a6a61fdfaab844e8560d8192014b3b1970bda8 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 (release-2.2) 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 a05b19cf8dc..dbd74c980e2 100644 --- a/core/chaincode/platforms/golang/list_test.go +++ b/core/chaincode/platforms/golang/list_test.go @@ -123,5 +123,6 @@ func Test_listModuleInfoFailure(t *testing.T) { require.NoError(t, err, "failed to change to temporary directory") _, err = listModuleInfo() - assert.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") }