Skip to content

Commit

Permalink
Go syntax fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhittington21 committed Mar 13, 2017
1 parent c57485c commit e433db7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions cmd/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ func (s *store) AddRoleToNamespace(namespace string, role string) {
roleARN := s.iam.roleARN(role)

ar := s.rolesByNamespace[namespace]
if ar == nil {
ar = []string{}
}

// this is a tiny bit troubling, we could go with a the rolesByNamespace
// being a map[string]map[string]bool so that deduplication isn't
Expand Down Expand Up @@ -111,12 +108,8 @@ func (s *store) DeleteNamespace(namespace string) {
// returns true if the role is found, otheriwse false
func (s *store) checkRoleForNamespace(role string, namespace string) bool {
ar := s.rolesByNamespace[namespace]
if ar == nil {
log.Warnf("Role:%s on namespace:%s not found.", role, namespace)
return false
}
for i := range ar {
if ar[i] == role {
for _, r := range ar {
if r == role {
log.Debugf("Role:%s on namespace:%s found.", role, namespace)
return true
}
Expand Down

0 comments on commit e433db7

Please sign in to comment.