Skip to content

Commit

Permalink
DRY up function
Browse files Browse the repository at this point in the history
Remove commented out code
  • Loading branch information
Patrick Robinson committed Mar 4, 2019
1 parent bc42f21 commit a21f305
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions iamy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ func NewPolicyDocumentFromJson(jsonString string) (*PolicyDocument, error) {
log.Printf("Error unmarshalling JSON %s %s", err, jsonString)
return nil, err
}
//log.Printf("Doc %s\nJSON: %s", doc, jsonString)

return &doc, nil
}
Expand All @@ -24,14 +23,8 @@ func NewPolicyDocumentFromEncodedJson(encoded string) (*PolicyDocument, error) {
if err != nil {
return nil, err
}
var doc PolicyDocument
if err := json.Unmarshal([]byte(jsonString), &doc); err != nil {
log.Printf("Error unmarshalling JSON %s %s", err, jsonString)
return nil, err
}
//log.Printf("Doc %s\nJSON: %s", doc, jsonString)

return &doc, nil
return NewPolicyDocumentFromJson(jsonString)
}

// PolicyDocument represents an AWS policy document.
Expand Down

0 comments on commit a21f305

Please sign in to comment.