Skip to content

Commit

Permalink
Add number to error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Jul 8, 2022
1 parent de0f817 commit c188b29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aws_policy_equivalence.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ func PoliciesAreEquivalent(policy1, policy2 string) (bool, error) {

policy1intermediate := &intermediatePolicyDocument{}
if err := json.Unmarshal([]byte(policy1), policy1intermediate); err != nil {
return false, fmt.Errorf("unmarshaling policy: %s", err)
return false, fmt.Errorf("unmarshaling policy 1: %s", err)
}

policy2intermediate := &intermediatePolicyDocument{}
if err := json.Unmarshal([]byte(policy2), policy2intermediate); err != nil {
return false, fmt.Errorf("unmarshaling policy: %s", err)
return false, fmt.Errorf("unmarshaling policy 2: %s", err)
}

if reflect.DeepEqual(policy1intermediate, policy2intermediate) {
Expand Down Expand Up @@ -88,12 +88,12 @@ func (intermediate *intermediatePolicyDocument) document() (*policyDocument, err
switch s := intermediate.Statements.(type) {
case []interface{}:
if err := mapstructure.Decode(s, &statements); err != nil {
return nil, fmt.Errorf("parsing statement: %s", err)
return nil, fmt.Errorf("parsing statement 1: %s", err)
}
case map[string]interface{}:
var singleStatement *policyStatement
if err := mapstructure.Decode(s, &singleStatement); err != nil {
return nil, fmt.Errorf("parsing statement: %s", err)
return nil, fmt.Errorf("parsing statement 2: %s", err)
}
statements = append(statements, singleStatement)
default:
Expand Down

0 comments on commit c188b29

Please sign in to comment.