From 38c71817ece5329614844b8d5d36102af7dbbee1 Mon Sep 17 00:00:00 2001 From: YCK1130 Date: Wed, 17 Jul 2024 15:16:35 +0100 Subject: [PATCH] chore: format code --- application/jira/v0/component_test.go | 10 +++++----- application/jira/v0/mock_server.go | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/jira/v0/component_test.go b/application/jira/v0/component_test.go index 931462cd8..37e8a7193 100644 --- a/application/jira/v0/component_test.go +++ b/application/jira/v0/component_test.go @@ -16,8 +16,8 @@ import ( ) const ( - email = "testemail@gmail.com" - token = "testToken" + email = "testemail@gmail.com" + token = "testToken" ) type TaskCase[inType any, outType any] struct { @@ -383,7 +383,7 @@ func TestComponent_ListIssuesTask(t *testing.T) { MaxResults: 10, StartAt: 0, Range: Range{ - Range: "Issues of an epic", + Range: "Issues of an epic", EpicKey: "KAN-4", }, }, @@ -402,7 +402,7 @@ func TestComponent_ListIssuesTask(t *testing.T) { MaxResults: 10, StartAt: 0, Range: Range{ - Range: "Issues of an epic", + Range: "Issues of an epic", EpicKey: "KAN-4" + strings.Repeat("-0", 100), }, }, @@ -421,7 +421,7 @@ func TestComponent_ListIssuesTask(t *testing.T) { MaxResults: 10, StartAt: 0, Range: Range{ - Range: "Issues of a sprint", + Range: "Issues of a sprint", SprintKey: "1", }, }, diff --git a/application/jira/v0/mock_server.go b/application/jira/v0/mock_server.go index 4ad85c80e..4f30f5d55 100644 --- a/application/jira/v0/mock_server.go +++ b/application/jira/v0/mock_server.go @@ -283,18 +283,18 @@ func mockListIssues(res http.ResponseWriter, req *http.Request) { _, _ = res.Write([]byte(respText)) } - type MockIssuesSearchRequest struct { JQL string `json:"jql"` - StartAt int `json:"startAt"` - MaxResults int `json:"maxResults"` + StartAt int `json:"startAt"` + MaxResults int `json:"maxResults"` } + func mockIssuesSearch(res http.ResponseWriter, req *http.Request) { var err error var ( - opt url.Values - jql string - startAt string + opt url.Values + jql string + startAt string maxResults string ) if req.Method == http.MethodGet { @@ -302,7 +302,7 @@ func mockIssuesSearch(res http.ResponseWriter, req *http.Request) { jql = opt.Get("jql") startAt = opt.Get("startAt") maxResults = opt.Get("maxResults") - }else if req.Method == http.MethodPost { + } else if req.Method == http.MethodPost { body := MockIssuesSearchRequest{} err = json.NewDecoder(req.Body).Decode(&body) if err != nil { @@ -312,7 +312,7 @@ func mockIssuesSearch(res http.ResponseWriter, req *http.Request) { jql = body.JQL startAt = strconv.Itoa(body.StartAt) maxResults = strconv.Itoa(body.MaxResults) - }else{ + } else { res.WriteHeader(http.StatusMethodNotAllowed) _, _ = res.Write([]byte(`{"errorMessages":["Method not allowed"]}`)) return