Skip to content

Commit

Permalink
run golangcli-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Yang <[email protected]>
  • Loading branch information
Rui Yang authored and CI Bot committed Mar 20, 2021
1 parent cbee569 commit 75f4a22
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions connector/cf/cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,38 +192,36 @@ func (c *cfConnector) LoginURL(scopes connector.Scopes, callbackURL, state strin
}

func fetchRoleSpaces(baseURL, path, role string, client *http.Client) ([]Space, error) {
var spaces []Space

resources, err := fetchResources(baseURL, path, client)
if err != nil {
return nil, fmt.Errorf("failed to fetch resources: %v", err)
}

for _, resource := range resources {
spaces = append(spaces, Space{
spaces := make([]Space, len(resources))
for i, resource := range resources {
spaces[i] = Space{
Name: resource.Entity.Name,
GUID: resource.Metadata.GUID,
OrgGUID: resource.Entity.OrganizationGUID,
Role: role,
})
}
}

return spaces, nil
}

func fetchOrgs(baseURL, path string, client *http.Client) ([]Org, error) {
var orgs []Org

resources, err := fetchResources(baseURL, path, client)
if err != nil {
return nil, fmt.Errorf("failed to fetch resources: %v", err)
}

for _, resource := range resources {
orgs = append(orgs, Org{
orgs := make([]Org, len(resources))
for i, resource := range resources {
orgs[i] = Org{
Name: resource.Entity.Name,
GUID: resource.Metadata.GUID,
})
}
}

return orgs, nil
Expand Down Expand Up @@ -293,7 +291,7 @@ func getGroupsClaims(orgs []Org, spaces []Space) []string {
}
}

var groups []string
groups := make([]string, 0, len(groupsClaims))
for group := range groupsClaims {
groups = append(groups, group)
}
Expand Down

0 comments on commit 75f4a22

Please sign in to comment.