From 82f603de0ba0f85bf7e9551a2725be01e65ae44a Mon Sep 17 00:00:00 2001 From: Kristof Daja Date: Sun, 28 Feb 2021 10:32:07 +0100 Subject: [PATCH] Small corrections in contribute files * Added a guard in contribute/main.go * Added query params to the client.Project.Milestone.List call --- contribute/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contribute/main.go b/contribute/main.go index 4623fb5..720c4d8 100644 --- a/contribute/main.go +++ b/contribute/main.go @@ -53,6 +53,14 @@ func init() { * fileAttachmentUploadPath = "C:\\Images\\Bad-puns-make-me-sic.1.jpg" // WINDOWS */ + for _, v := range []string{taigaUsername, taigaPassword, sandboxProjectSlug, sandboxEpicID, sandboxFileUploadPath} { + if v == "" { + log.Fatalln("All mandatory values must be set through an environment variable.", + "See README.md in the contribute folder for details!", + ) + } + } + // Convert Epic ID string to int var e error sandboxEpicID2, e = strconv.Atoi(sandboxEpicID) @@ -156,7 +164,7 @@ func main() { // Get milestones (for default project if set) // (total of 3; limited by the for-loop) log.Printf("Getting all Milestones(Sprints) for Project ID=%d, and printing the first 3 to the console:\n", project.ID) - milestones, mti, err := client.Project.Milestone.List(nil) + milestones, mti, err := client.Project.Milestone.List(&taiga.MilestonesQueryParams{Project: project.ID}) if err != nil { log.Println(err) return