Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
YCK1130 committed Jul 17, 2024
1 parent 9a4b444 commit 38c7181
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions application/jira/v0/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
)

const (
email = "[email protected]"
token = "testToken"
email = "[email protected]"
token = "testToken"
)

type TaskCase[inType any, outType any] struct {
Expand Down Expand Up @@ -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",
},
},
Expand All @@ -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),
},
},
Expand All @@ -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",
},
},
Expand Down
16 changes: 8 additions & 8 deletions application/jira/v0/mock_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,26 +283,26 @@ 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 {
opt = req.URL.Query()
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 {
Expand All @@ -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
Expand Down

0 comments on commit 38c7181

Please sign in to comment.