Skip to content

Commit 6c8dfe3

Browse files
authored
test: fix golang lint issue with pr tests (#28)
1 parent 808008d commit 6c8dfe3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/pr_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/gruntwork-io/terratest/modules/terraform"
1212
"github.com/stretchr/testify/assert"
13+
"github.com/stretchr/testify/require"
1314
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
1415
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
1516
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
@@ -85,7 +86,9 @@ func TestRunUpgradeCompleteExample(t *testing.T) {
8586

8687
// Generate a 15 char long random string for the admin_pass
8788
randomBytes := make([]byte, 13)
88-
rand.Read(randomBytes)
89+
_, randErr := rand.Read(randomBytes)
90+
require.Nil(t, randErr) // do not proceed if we can't gen a random password
91+
8992
randomPass := "A1" + base64.URLEncoding.EncodeToString(randomBytes)[:13]
9093

9194
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{

0 commit comments

Comments
 (0)