1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

format with gofumpt (#18184)

* gofumpt -w -l .

* gofumpt -w -l -extra .

* Add linter

* manual fix

* change make fmt
This commit is contained in:
6543
2022-01-20 18:46:10 +01:00
committed by GitHub
parent 1d98d205f5
commit 54e9ee37a7
423 changed files with 1585 additions and 1758 deletions

View File

@@ -53,21 +53,21 @@ func TestAPIModifyLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
//ListLabels
// ListLabels
req = NewRequest(t, "GET", urlStr)
resp = session.MakeRequest(t, req, http.StatusOK)
var apiLabels []*api.Label
DecodeJSON(t, resp, &apiLabels)
assert.Len(t, apiLabels, 2)
//GetLabel
// GetLabel
singleURLStr := fmt.Sprintf("/api/v1/repos/%s/%s/labels/%d?token=%s", owner.Name, repo.Name, dbLabel.ID, token)
req = NewRequest(t, "GET", singleURLStr)
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &apiLabel)
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
//EditLabel
// EditLabel
newName := "LabelNewName"
newColor := "09876a"
newColorWrong := "09g76a"
@@ -83,10 +83,9 @@ func TestAPIModifyLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
//DeleteLabel
// DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
session.MakeRequest(t, req, http.StatusNoContent)
}
func TestAPIAddIssueLabels(t *testing.T) {
@@ -173,21 +172,21 @@ func TestAPIModifyOrgLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
//ListLabels
// ListLabels
req = NewRequest(t, "GET", urlStr)
resp = session.MakeRequest(t, req, http.StatusOK)
var apiLabels []*api.Label
DecodeJSON(t, resp, &apiLabels)
assert.Len(t, apiLabels, 4)
//GetLabel
// GetLabel
singleURLStr := fmt.Sprintf("/api/v1/orgs/%s/labels/%d?token=%s", owner.Name, dbLabel.ID, token)
req = NewRequest(t, "GET", singleURLStr)
resp = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, resp, &apiLabel)
assert.EqualValues(t, strings.TrimLeft(dbLabel.Color, "#"), apiLabel.Color)
//EditLabel
// EditLabel
newName := "LabelNewName"
newColor := "09876a"
newColorWrong := "09g76a"
@@ -203,8 +202,7 @@ func TestAPIModifyOrgLabels(t *testing.T) {
})
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
//DeleteLabel
// DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
session.MakeRequest(t, req, http.StatusNoContent)
}