Skip to content

Commit

Permalink
Small corrections in contribute files
Browse files Browse the repository at this point in the history
  * Added a guard in contribute/main.go
  * Added query params to the client.Project.Milestone.List call
  • Loading branch information
theriverman committed Feb 28, 2021
1 parent 8160325 commit 82f603d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contribute/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 82f603d

Please sign in to comment.