summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2024-05-18 12:13:45 -0600
committermo khan <mo@mokhan.ca>2024-05-18 12:13:45 -0600
commit41fe3a65860c6d9572e4dde4682d8233a3bd3ba3 (patch)
treede36e942848a5b21a8254d360fad43636602036a /cmd
parentcf1abd6a058af31659fe8692ae771d0f5d63626b (diff)
test: start to add unit tests
Diffstat (limited to 'cmd')
-rw-r--r--cmd/stanuki/main.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/cmd/stanuki/main.go b/cmd/stanuki/main.go
index 332c1ad..18284d4 100644
--- a/cmd/stanuki/main.go
+++ b/cmd/stanuki/main.go
@@ -9,16 +9,9 @@ import (
"github.com/xlgmokha/x/pkg/env"
"github.com/xlgmokha/x/pkg/serde"
"github.com/xlgmokha/x/pkg/x"
+ "gitlab.com/mokhax/stanuki/pkg/gitlab"
)
-type Issue struct {
- ID int `json:"id"`
- IID int `json:"iid"`
- ProjectID int `json:"project_id"`
- Title string `json:"title"`
- Description string `json:"description"`
-}
-
func main() {
token := env.Fetch("GITLAB_TOKEN", "")
url := "https://gitlab.com/api/v4/groups/9970/issues"
@@ -29,7 +22,7 @@ func main() {
if env.Fetch("DUMP", "") != "" {
fmt.Println(string(x.Must(io.ReadAll(response.Body))))
} else {
- issues := x.Must(serde.From[[]Issue](response.Body, serde.JSON))
+ issues := x.Must(serde.From[[]gitlab.Issue](response.Body, serde.JSON))
for _, issue := range issues {
fmt.Printf("%v: %v\n", issue.ID, issue.Title)
}