Skip to content

Commit d9ff63b

Browse files
Correcetd indentation
1 parent 72fef4e commit d9ff63b

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

terratest/common/awshelper.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
package common
22

33
import (
4+
"context"
45
"fmt"
5-
"io/ioutil"
6-
"net/http"
7-
"strings"
8-
"context"
96
aws_sdk "github.com/aws/aws-sdk-go-v2/aws"
107
"github.com/aws/aws-sdk-go-v2/config"
118
"github.com/aws/aws-sdk-go-v2/service/ec2"
9+
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
1210
elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2"
1311
elbv2types "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types"
14-
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
1512
"github.com/gruntwork-io/terratest/modules/aws"
1613
"github.com/stretchr/testify/assert"
14+
"io/ioutil"
15+
"net/http"
16+
"strings"
1717
)
1818

1919
// createELB will create the Load Balancer, target group, modify the security group for your IP.
@@ -72,7 +72,7 @@ func (a *ResourcesAssert) CreateELB(LoadBalancerName, TargetGroupName string) (*
7272
LoadBalancerArn: lb_id,
7373
Protocol: elbv2types.ProtocolEnumHttp,
7474
Port: aws_sdk.Int32(80),
75-
DefaultActions: []elbv2types.Action{
75+
DefaultActions: []elbv2types.Action{
7676
{Type: elbv2types.ActionTypeEnumForward, TargetGroupArn: tg_id},
7777
},
7878
})

terratest/common/common.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,20 @@ func AssertObject(t *testing.T, expectedKey string, expectedValue interface{}, a
150150
default:
151151
fmt.Println("**** Compairing Key { " + expectedKey + " } ****")
152152

153-
// If expected is a (non-empty, valid) JSON string, compare as JSON
154-
if es, ok := expectedValue.(string); ok && isValidJSONStr(es) {
155-
as, ok2 := toJSONString(actualValue)
156-
if !ok2 || !isValidJSONStr(as) {
157-
// Decide what you want here: strict fail or fallback to raw equality
158-
require.Failf(t,
159-
"invalid actual JSON",
160-
"key %s: expected valid JSON, but actual isn't valid JSON/stringifies \nactual: %#v",
161-
expectedKey, actualValue)
162-
}
163-
require.JSONEqf(t, es, as, "key %s: JSON mismatch", expectedKey)
164-
}else {
165-
assert.Equal(t, expectedValue, actualValue, fmt.Sprintf("Mismatch between actual value and expected values for key %v.", expectedKey))
166-
}
153+
// If expected is a (non-empty, valid) JSON string, compare as JSON
154+
if es, ok := expectedValue.(string); ok && isValidJSONStr(es) {
155+
as, ok2 := toJSONString(actualValue)
156+
if !ok2 || !isValidJSONStr(as) {
157+
// Decide what you want here: strict fail or fallback to raw equality
158+
require.Failf(t,
159+
"invalid actual JSON",
160+
"key %s: expected valid JSON, but actual isn't valid JSON/stringifies \nactual: %#v",
161+
expectedKey, actualValue)
162+
}
163+
require.JSONEqf(t, es, as, "key %s: JSON mismatch", expectedKey)
164+
} else {
165+
assert.Equal(t, expectedValue, actualValue, fmt.Sprintf("Mismatch between actual value and expected values for key %v.", expectedKey))
166+
}
167167
}
168168
}
169169

0 commit comments

Comments
 (0)