package models type ScopeEntry struct { ID int `json:"id"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` } type ScopeMember struct { ID string `json:"id"` Name string `json:"name"` Owner bool `json:"owner"` } type Scope struct { ScopeEntry DisplayName string `json:"displayName"` Members []ScopeMember `json:"members"` Projects []ProjectEntry `json:"projects"` Stats []Stat `json:"stats"` } func (s *Scope) HasMember(id string) bool { for _, user := range s.Members { if user.ID == id { return true } } return false }