diff options
author | Nanguan Lin <70063547+lng2020@users.noreply.github.com> | 2023-12-20 03:12:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 20:12:02 +0100 |
commit | 6a725b6f9cde28862869befb9d2b101d9e342427 (patch) | |
tree | fb349df42af6fb943a49a57383fcf3619b097e13 /services/issue/assignee_test.go | |
parent | e7cb8da2a8310ac167b6f613b283caa3316a7154 (diff) | |
download | gitea-6a725b6f9cde28862869befb9d2b101d9e342427.tar.gz gitea-6a725b6f9cde28862869befb9d2b101d9e342427.zip |
Remove deadcode under models/issues (#28536)
Using the Go Official tool `golang.org/x/tools/cmd/deadcode@latest`
mentioned by [go blog](https://go.dev/blog/deadcode).
Just use `deadcode .` in the project root folder and it gives a list of
unused functions. Though it has some false alarms.
This PR removes dead code detected in `models/issues`.
Diffstat (limited to 'services/issue/assignee_test.go')
-rw-r--r-- | services/issue/assignee_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/issue/assignee_test.go b/services/issue/assignee_test.go index e16b012a17..da25da60ee 100644 --- a/services/issue/assignee_test.go +++ b/services/issue/assignee_test.go @@ -18,8 +18,12 @@ func TestDeleteNotPassedAssignee(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) // Fake issue with assignees - issue, err := issues_model.GetIssueWithAttrsByID(db.DefaultContext, 1) + issue, err := issues_model.GetIssueByID(db.DefaultContext, 1) assert.NoError(t, err) + + err = issue.LoadAttributes(db.DefaultContext) + assert.NoError(t, err) + assert.Len(t, issue.Assignees, 1) user1, err := user_model.GetUserByID(db.DefaultContext, 1) // This user is already assigned (see the definition in fixtures), so running UpdateAssignee should unassign him |