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`.
This commit is contained in:
parent
e7cb8da2a8
commit
6a725b6f9c
11 changed files with 9 additions and 200 deletions
|
@ -164,30 +164,6 @@ func TestGetLabelInOrgByName(t *testing.T) {
|
|||
assert.True(t, issues_model.IsErrOrgLabelNotExist(err))
|
||||
}
|
||||
|
||||
func TestGetLabelInOrgByNames(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
labelIDs, err := issues_model.GetLabelIDsInOrgByNames(db.DefaultContext, 3, []string{"orglabel3", "orglabel4"})
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Len(t, labelIDs, 2)
|
||||
|
||||
assert.Equal(t, int64(3), labelIDs[0])
|
||||
assert.Equal(t, int64(4), labelIDs[1])
|
||||
}
|
||||
|
||||
func TestGetLabelInOrgByNamesDiscardsNonExistentLabels(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
// orglabel99 doesn't exists.. See labels.yml
|
||||
labelIDs, err := issues_model.GetLabelIDsInOrgByNames(db.DefaultContext, 3, []string{"orglabel3", "orglabel4", "orglabel99"})
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Len(t, labelIDs, 2)
|
||||
|
||||
assert.Equal(t, int64(3), labelIDs[0])
|
||||
assert.Equal(t, int64(4), labelIDs[1])
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestGetLabelInOrgByID(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
label, err := issues_model.GetLabelInOrgByID(db.DefaultContext, 3, 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue