From 9ef6c6105117e593c5ea1d9414f21b57a6e63c5c Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Wed, 23 Aug 2023 11:55:45 -0500 Subject: [PATCH] Combine functions --- projectlist.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projectlist.go b/projectlist.go index 76f08e0..47b911b 100644 --- a/projectlist.go +++ b/projectlist.go @@ -55,6 +55,12 @@ func (projectlist *ProjectList) AddProject(project *Project) { projectlist.Projects[0] = project } +// AddProjects adds all passed projects to the list +func (projectlist *ProjectList) AddProjects(projects []*Project) { + projectlist.Projects = append(projectlist.Projects, projects...) +} +func (projectlist *ProjectList) Combine(other *ProjectList) { projectlist.AddProjects(other.Projects) } + // GetProject returns the Project with the given project 'id' form the ProjectList. // Returns an error if Project could not be found. func (projectlist *ProjectList) GetProject(id int) (*Project, error) {