Fully Initialize on New

This commit is contained in:
Brian Buller 2023-08-23 11:29:59 -05:00
parent c0e6b72ed3
commit dcfd80d082

View File

@ -13,17 +13,9 @@ type ProjectList struct {
Projects []*Project `json:"projects"` Projects []*Project `json:"projects"`
} }
func NewProjectList() *ProjectList { func NewProjectList() *ProjectList { return &ProjectList{Projects: []*Project{}} }
return &ProjectList{} func (projectlist *ProjectList) Size() int { return len(projectlist.Projects) }
} func (projectlist *ProjectList) GetProjectSlice() []*Project { return projectlist.Projects }
func (projectlist *ProjectList) Size() int {
return len(projectlist.Projects)
}
func (projectlist *ProjectList) GetProjectSlice() []*Project {
return projectlist.Projects
}
func (projectlist *ProjectList) GetProjectsWithContext(context string) *ProjectList { func (projectlist *ProjectList) GetProjectsWithContext(context string) *ProjectList {
return projectlist.Filter(func(p *Project) bool { return projectlist.Filter(func(p *Project) bool {