Skip to content

Commit

Permalink
remove contains function and add proper description for GetGroupByNam…
Browse files Browse the repository at this point in the history
…e method
  • Loading branch information
pascal-fischer committed Jan 18, 2024
1 parent 6951253 commit a650dc9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion management/server/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (am *DefaultAccountManager) GetGroup(accountID, groupID string) (*Group, er
return nil, status.Errorf(status.NotFound, "group with ID %s not found", groupID)
}

// GetGroupByName
// GetGroupByName filters all groups in an account by name and returns the one with the most peers
func (am *DefaultAccountManager) GetGroupByName(groupName, accountID string) (*Group, error) {
unlock := am.Store.AcquireAccountLock(accountID)
defer unlock()
Expand Down
10 changes: 0 additions & 10 deletions util/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,3 @@ func FileExists(path string) bool {
_, err := os.Stat(path)
return err == nil
}

// Contains checks if a slice of strings contains a specific string.
func Contains(slice []string, str string) bool {
for _, item := range slice {
if item == str {
return true
}
}
return false
}

0 comments on commit a650dc9

Please sign in to comment.