Skip to content

Commit

Permalink
Fix 'panic: runtime error: slice bounds out of range [:30] with lengt…
Browse files Browse the repository at this point in the history
…h 29'.
  • Loading branch information
ewbankkit committed Feb 12, 2024
1 parent f481d49 commit 9e93b0c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/service/elbv2/listener_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ func TestAccELBV2ListenerRule_updateForwardBasic(t *testing.T) {
var conf awstypes.Rule
resourceName := "aws_lb_listener_rule.test"
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
rName = rName[:30]
if len(rName) > 30 {
rName = rName[:30]
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
Expand Down Expand Up @@ -845,7 +847,9 @@ func TestAccELBV2ListenerRule_ActionForward_IgnoreFields(t *testing.T) {
var conf awstypes.Rule
resourceName := "aws_lb_listener_rule.test"
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
rName = rName[:30]
if len(rName) > 30 {
rName = rName[:30]
}
key := acctest.TLSRSAPrivateKeyPEM(t, 2048)
certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com")

Expand Down

0 comments on commit 9e93b0c

Please sign in to comment.