Skip to content

Instantly share code, notes, and snippets.

@jpukg
Created February 10, 2022 14:13
Show Gist options
  • Save jpukg/244ebcc2ddaa5777b9ac2269fd124b1d to your computer and use it in GitHub Desktop.
Save jpukg/244ebcc2ddaa5777b9ac2269fd124b1d to your computer and use it in GitHub Desktop.
roles, err := svc.ListRoles(&iam.ListRolesInput{})
var jsonMap map[string]interface{}
unquote, err := url.PathUnescape(aws.StringValue(roles.Roles[0].AssumeRolePolicyDocument))
json.Unmarshal([]byte(unquote), &jsonMap)
data := model.Statement{}
json.Unmarshal([]byte(aws.StringValue(roles.Roles[0].AssumeRolePolicyDocument)), &data)
fmt.Printf("Operation: %s", data)
fmt.Println(roles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment