Browse Source

chore(models): rewrite code format. (#14754)

* chore: rewrite format.

* chore: update format

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: update format

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: Adjacent parameters with the same type should be grouped together

* chore: update format.
mj-v1.14.3
Bo-Yi Wu 2 years ago
committed by GitHub
parent
commit
167b0f46ef
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      models/access.go
  2. 6
      models/action.go
  3. 4
      models/admin.go
  4. 6
      models/attachment.go
  5. 5
      models/attachment_test.go
  6. 3
      models/commit_status.go
  7. 9
      models/error.go
  8. 5
      models/external_login_user.go
  9. 1
      models/fixture_generation.go
  10. 72
      models/gpg_key.go
  11. 10
      models/gpg_key_test.go
  12. 6
      models/helper.go
  13. 1
      models/helper_environment.go
  14. 35
      models/issue.go
  15. 6
      models/issue_assignees.go
  16. 12
      models/issue_comment.go
  17. 80
      models/issue_comment_list.go
  18. 4
      models/issue_dependency.go
  19. 5
      models/issue_label.go
  20. 1
      models/issue_label_test.go
  21. 62
      models/issue_list.go
  22. 2
      models/issue_lock.go
  23. 6
      models/issue_milestone.go
  24. 17
      models/issue_reaction.go
  25. 4
      models/issue_stopwatch.go
  26. 7
      models/issue_test.go
  27. 5
      models/issue_tracked_time.go
  28. 2
      models/issue_tracked_time_test.go
  29. 2
      models/issue_watch.go
  30. 7
      models/issue_xref.go
  31. 10
      models/lfs.go
  32. 2
      models/lfs_lock.go
  33. 2
      models/login_source.go
  34. 6
      models/migrate.go
  35. 4
      models/migrations/v100.go
  36. 1
      models/migrations/v104.go
  37. 1
      models/migrations/v105.go
  38. 1
      models/migrations/v107.go
  39. 2
      models/migrations/v111.go
  40. 3
      models/migrations/v114.go
  41. 2
      models/migrations/v115.go
  42. 1
      models/migrations/v116.go
  43. 1
      models/migrations/v122.go
  44. 1
      models/migrations/v124.go
  45. 2
      models/migrations/v128.go
  46. 1
      models/migrations/v129.go
  47. 3
      models/migrations/v130.go
  48. 2
      models/migrations/v134.go
  49. 2
      models/migrations/v136.go
  50. 2
      models/migrations/v144.go
  51. 1
      models/migrations/v146.go
  52. 8
      models/migrations/v147.go
  53. 1
      models/migrations/v156.go
  54. 1
      models/migrations/v157.go
  55. 12
      models/migrations/v158.go
  56. 2
      models/migrations/v161.go
  57. 2
      models/migrations/v162.go
  58. 3
      models/migrations/v70.go
  59. 1
      models/migrations/v71.go
  60. 2
      models/migrations/v76.go
  61. 1
      models/migrations/v79.go
  62. 4
      models/migrations/v88.go
  63. 1
      models/migrations/v92.go
  64. 4
      models/migrations/v96.go
  65. 2
      models/models.go
  66. 36
      models/notification.go
  67. 15
      models/oauth2.go
  68. 12
      models/org.go
  69. 8
      models/org_team.go
  70. 2
      models/org_team_test.go
  71. 12
      models/org_test.go
  72. 1
      models/project.go
  73. 6
      models/project_board.go
  74. 3
      models/project_issue.go
  75. 2
      models/project_test.go
  76. 3
      models/pull.go
  77. 8
      models/release.go
  78. 10
      models/repo.go
  79. 2
      models/repo_language_stats.go
  80. 15
      models/repo_list.go
  81. 188
      models/repo_list_test.go
  82. 3
      models/repo_test.go
  83. 3
      models/repo_transfer.go
  84. 1
      models/repo_transfer_test.go
  85. 3
      models/repo_unit.go
  86. 2
      models/repo_watch.go
  87. 11
      models/review.go
  88. 1
      models/review_test.go
  89. 24
      models/ssh_key.go
  90. 8
      models/task.go
  91. 1
      models/token_test.go
  92. 7
      models/topic.go
  93. 2
      models/unit_tests.go
  94. 11
      models/user.go
  95. 4
      models/user_heatmap.go
  96. 2
      models/user_heatmap_test.go
  97. 8
      models/user_mail.go
  98. 8
      models/user_openid.go
  99. 10
      models/user_test.go
  100. 8
      models/userlist.go

4
models/access.go

@ -121,8 +121,8 @@ func (user *User) GetRepositoryAccesses() (map[*Repository]AccessMode, error) {
}
defer rows.Close()
var repos = make(map[*Repository]AccessMode, 10)
var ownerCache = make(map[int64]*User, 10)
repos := make(map[*Repository]AccessMode, 10)
ownerCache := make(map[int64]*User, 10)
for rows.Next() {
var repo repoAccess
err = rows.Scan(&repo)

6
models/action.go

@ -186,7 +186,7 @@ func (a *Action) GetRepoLink() string {
}
// GetRepositoryFromMatch returns a *Repository from a username and repo strings
func GetRepositoryFromMatch(ownerName string, repoName string) (*Repository, error) {
func GetRepositoryFromMatch(ownerName, repoName string) (*Repository, error) {
var err error
refRepo, err := GetRepositoryByOwnerAndName(ownerName, repoName)
if err != nil {
@ -218,7 +218,7 @@ func (a *Action) getCommentLink(e Engine) string {
if len(a.GetIssueInfos()) == 0 {
return "#"
}
//Return link to issue
// Return link to issue
issueIDString := a.GetIssueInfos()[0]
issueID, err := strconv.ParseInt(issueIDString, 10, 64)
if err != nil {
@ -322,7 +322,7 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) {
return actions, nil
}
func activityReadable(user *User, doer *User) bool {
func activityReadable(user, doer *User) bool {
var doerID int64
if doer != nil {
doerID = doer.ID

4
models/admin.go

@ -14,11 +14,11 @@ import (
"code.gitea.io/gitea/modules/util"
)
//NoticeType describes the notice type
// NoticeType describes the notice type
type NoticeType int
const (
//NoticeRepository type
// NoticeRepository type
NoticeRepository NoticeType = iota + 1
// NoticeTask type
NoticeTask

6
models/attachment.go

@ -193,7 +193,7 @@ func DeleteAttachments(attachments []*Attachment, remove bool) (int, error) {
return 0, nil
}
var ids = make([]int64, 0, len(attachments))
ids := make([]int64, 0, len(attachments))
for _, a := range attachments {
ids = append(ids, a.ID)
}
@ -216,7 +216,6 @@ func DeleteAttachments(attachments []*Attachment, remove bool) (int, error) {
// DeleteAttachmentsByIssue deletes all attachments associated with the given issue.
func DeleteAttachmentsByIssue(issueID int64, remove bool) (int, error) {
attachments, err := GetAttachmentsByIssueID(issueID)
if err != nil {
return 0, err
}
@ -227,7 +226,6 @@ func DeleteAttachmentsByIssue(issueID int64, remove bool) (int, error) {
// DeleteAttachmentsByComment deletes all attachments associated with the given comment.
func DeleteAttachmentsByComment(commentID int64, remove bool) (int, error) {
attachments, err := GetAttachmentsByCommentID(commentID)
if err != nil {
return 0, err
}
@ -263,7 +261,7 @@ func IterateAttachment(f func(attach *Attachment) error) error {
var start int
const batchSize = 100
for {
var attachments = make([]*Attachment, 0, batchSize)
attachments := make([]*Attachment, 0, batchSize)
if err := x.Limit(batchSize, start).Find(&attachments); err != nil {
return err
}

5
models/attachment_test.go

@ -17,12 +17,12 @@ func TestUploadAttachment(t *testing.T) {
user := AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
var fPath = "./attachment_test.go"
fPath := "./attachment_test.go"
f, err := os.Open(fPath)
assert.NoError(t, err)
defer f.Close()
var buf = make([]byte, 1024)
buf := make([]byte, 1024)
n, err := f.Read(buf)
assert.NoError(t, err)
buf = buf[:n]
@ -152,7 +152,6 @@ func TestLinkedRepository(t *testing.T) {
assert.Equal(t, tc.expectedRepo.ID, repo.ID)
}
assert.Equal(t, tc.expectedUnitType, unitType)
})
}
}

3
models/commit_status.go

@ -176,12 +176,11 @@ func FindRepoRecentCommitStatusContexts(repoID int64, before time.Duration) ([]s
return nil, err
}
var contexts = make([]string, 0, len(ids))
contexts := make([]string, 0, len(ids))
if len(ids) == 0 {
return contexts, nil
}
return contexts, x.Select("context").Table("commit_status").In("id", ids).Find(&contexts)
}
// NewCommitStatusOptions holds options for creating a CommitStatus

9
models/error.go

@ -72,8 +72,7 @@ func (err ErrNameCharsNotAllowed) Error() string {
}
// ErrSSHDisabled represents an "SSH disabled" error.
type ErrSSHDisabled struct {
}
type ErrSSHDisabled struct{}
// IsErrSSHDisabled checks if an error is a ErrSSHDisabled.
func IsErrSSHDisabled(err error) bool {
@ -269,8 +268,7 @@ func (err ErrUserHasOrgs) Error() string {
}
// ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
type ErrUserNotAllowedCreateOrg struct {
}
type ErrUserNotAllowedCreateOrg struct{}
// IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
func IsErrUserNotAllowedCreateOrg(err error) bool {
@ -603,8 +601,7 @@ func (err ErrAccessTokenNotExist) Error() string {
}
// ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
type ErrAccessTokenEmpty struct {
}
type ErrAccessTokenEmpty struct{}
// IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
func IsErrAccessTokenEmpty(err error) bool {

5
models/external_login_user.go

@ -45,7 +45,6 @@ func ListAccountLinks(user *User) ([]*ExternalLoginUser, error) {
err := x.Where("user_id=?", user.ID).
Desc("login_source_id").
Find(&externalAccounts)
if err != nil {
return nil, err
}
@ -87,7 +86,7 @@ func removeAllAccountLinks(e Engine, user *User) error {
}
// GetUserIDByExternalUserID get user id according to provider and userID
func GetUserIDByExternalUserID(provider string, userID string) (int64, error) {
func GetUserIDByExternalUserID(provider, userID string) (int64, error) {
var id int64
_, err := x.Table("external_login_user").
Select("user_id").
@ -147,7 +146,7 @@ type FindExternalUserOptions struct {
}
func (opts FindExternalUserOptions) toConds() builder.Cond {
var cond = builder.NewCond()
cond := builder.NewCond()
if len(opts.Provider) > 0 {
cond = cond.And(builder.Eq{"provider": opts.Provider})
}

1
models/fixture_generation.go

@ -12,7 +12,6 @@ import (
// GetYamlFixturesAccess returns a string containing the contents
// for the access table, as recalculated using repo.RecalculateAccesses()
func GetYamlFixturesAccess() (string, error) {
repos := make([]*Repository, 0, 50)
if err := x.Find(&repos); err != nil {
return "", err

72
models/gpg_key.go

@ -44,7 +44,7 @@ type GPGKey struct {
CanCertify bool
}
//GPGKeyImport the original import of key
// GPGKeyImport the original import of key
type GPGKeyImport struct {
KeyID string `xorm:"pk CHAR(16) NOT NULL"`
Content string `xorm:"TEXT NOT NULL"`
@ -118,9 +118,9 @@ func checkArmoredGPGKeyString(content string) (openpgp.EntityList, error) {
return list, nil
}
//addGPGKey add key, import and subkeys to database
// addGPGKey add key, import and subkeys to database
func addGPGKey(e Engine, key *GPGKey, content string) (err error) {
//Add GPGKeyImport
// Add GPGKeyImport
if _, err = e.Insert(GPGKeyImport{
KeyID: key.KeyID,
Content: content,
@ -140,7 +140,7 @@ func addGPGKey(e Engine, key *GPGKey, content string) (err error) {
return nil
}
//addGPGSubKey add subkeys to database
// addGPGSubKey add subkeys to database
func addGPGSubKey(e Engine, key *GPGKey) (err error) {
// Save GPG primary key.
if _, err = e.Insert(key); err != nil {
@ -177,7 +177,7 @@ func AddGPGKey(ownerID int64, content string) ([]*GPGKey, error) {
return nil, ErrGPGKeyIDAlreadyUsed{ekey.PrimaryKey.KeyIdString()}
}
//Get DB session
// Get DB session
key, err := parseGPGKey(ownerID, ekey)
if err != nil {
@ -192,7 +192,7 @@ func AddGPGKey(ownerID int64, content string) ([]*GPGKey, error) {
return keys, sess.Commit()
}
//base64EncPubKey encode public key content to base 64
// base64EncPubKey encode public key content to base 64
func base64EncPubKey(pubkey *packet.PublicKey) (string, error) {
var w bytes.Buffer
err := pubkey.Serialize(&w)
@ -202,18 +202,18 @@ func base64EncPubKey(pubkey *packet.PublicKey) (string, error) {
return base64.StdEncoding.EncodeToString(w.Bytes()), nil
}
//base64DecPubKey decode public key content from base 64
// base64DecPubKey decode public key content from base 64
func base64DecPubKey(content string) (*packet.PublicKey, error) {
b, err := readerFromBase64(content)
if err != nil {
return nil, err
}
//Read key
// Read key
p, err := packet.Read(b)
if err != nil {
return nil, err
}
//Check type
// Check type
pkey, ok := p.(*packet.PublicKey)
if !ok {
return nil, fmt.Errorf("key is not a public key")
@ -221,7 +221,7 @@ func base64DecPubKey(content string) (*packet.PublicKey, error) {
return pkey, nil
}
//GPGKeyToEntity retrieve the imported key and the traducted entity
// GPGKeyToEntity retrieve the imported key and the traducted entity
func GPGKeyToEntity(k *GPGKey) (*openpgp.Entity, error) {
impKey, err := GetGPGImportByKeyID(k.KeyID)
if err != nil {
@ -234,7 +234,7 @@ func GPGKeyToEntity(k *GPGKey) (*openpgp.Entity, error) {
return keys[0], err
}
//parseSubGPGKey parse a sub Key
// parseSubGPGKey parse a sub Key
func parseSubGPGKey(ownerID int64, primaryID string, pubkey *packet.PublicKey, expiry time.Time) (*GPGKey, error) {
content, err := base64EncPubKey(pubkey)
if err != nil {
@ -254,10 +254,10 @@ func parseSubGPGKey(ownerID int64, primaryID string, pubkey *packet.PublicKey, e
}, nil
}
//getExpiryTime extract the expire time of primary key based on sig
// getExpiryTime extract the expire time of primary key based on sig
func getExpiryTime(e *openpgp.Entity) time.Time {
expiry := time.Time{}
//Extract self-sign for expire date based on : https://github.com/golang/crypto/blob/master/openpgp/keys.go#L165
// Extract self-sign for expire date based on : https://github.com/golang/crypto/blob/master/openpgp/keys.go#L165
var selfSig *packet.Signature
for _, ident := range e.Identities {
if selfSig == nil {
@ -273,12 +273,12 @@ func getExpiryTime(e *openpgp.Entity) time.Time {
return expiry
}
//parseGPGKey parse a PrimaryKey entity (primary key + subs keys + self-signature)
// parseGPGKey parse a PrimaryKey entity (primary key + subs keys + self-signature)
func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
pubkey := e.PrimaryKey
expiry := getExpiryTime(e)
//Parse Subkeys
// Parse Subkeys
subkeys := make([]*GPGKey, len(e.Subkeys))
for i, k := range e.Subkeys {
subs, err := parseSubGPGKey(ownerID, pubkey.KeyIdString(), k.PublicKey, expiry)
@ -288,7 +288,7 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
subkeys[i] = subs
}
//Check emails
// Check emails
userEmails, err := GetEmailAddresses(ownerID)
if err != nil {
return nil, err
@ -308,7 +308,7 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
}
}
//In the case no email as been found
// In the case no email as been found
if len(emails) == 0 {
failedEmails := make([]string, 0, len(e.Identities))
for _, ident := range e.Identities {
@ -340,9 +340,9 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity) (*GPGKey, error) {
// deleteGPGKey does the actual key deletion
func deleteGPGKey(e *xorm.Session, keyID string) (int64, error) {
if keyID == "" {
return 0, fmt.Errorf("empty KeyId forbidden") //Should never happen but just to be sure
return 0, fmt.Errorf("empty KeyId forbidden") // Should never happen but just to be sure
}
//Delete imported key
// Delete imported key
n, err := e.Where("key_id=?", keyID).Delete(new(GPGKeyImport))
if err != nil {
return n, err
@ -452,11 +452,11 @@ func extractSignature(s string) (*packet.Signature, error) {
}
func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error {
//Check if key can sign
// Check if key can sign
if !k.CanSign {
return fmt.Errorf("key can not sign")
}
//Decode key
// Decode key
pkey, err := base64DecPubKey(k.Content)
if err != nil {
return err
@ -465,9 +465,9 @@ func verifySign(s *packet.Signature, h hash.Hash, k *GPGKey) error {
}
func hashAndVerify(sig *packet.Signature, payload string, k *GPGKey, committer, signer *User, email string) *CommitVerification {
//Generating hash of commit
// Generating hash of commit
hash, err := populateHash(sig.Hash, []byte(payload))
if err != nil { //Skipping failed to generate hash
if err != nil { // Skipping failed to generate hash
log.Error("PopulateHash: %v", err)
return &CommitVerification{
CommittingUser: committer,
@ -477,7 +477,7 @@ func hashAndVerify(sig *packet.Signature, payload string, k *GPGKey, committer,
}
if err := verifySign(sig, hash, k); err == nil {
return &CommitVerification{ //Everything is ok
return &CommitVerification{ // Everything is ok
CommittingUser: committer,
Verified: true,
Reason: fmt.Sprintf("%s / %s", signer.Name, k.KeyID),
@ -495,7 +495,7 @@ func hashAndVerifyWithSubKeys(sig *packet.Signature, payload string, k *GPGKey,
return commitVerification
}
//And test also SubsKey
// And test also SubsKey
for _, sk := range k.SubsKey {
commitVerification := hashAndVerify(sig, payload, sk, committer, signer, email)
if commitVerification != nil {
@ -620,9 +620,9 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
var committer *User
if c.Committer != nil {
var err error
//Find Committer account
committer, err = GetUserByEmail(c.Committer.Email) //This finds the user by primary email or activated email so commit will not be valid if email is not
if err != nil { //Skipping not user for commiter
// Find Committer account
committer, err = GetUserByEmail(c.Committer.Email) // This finds the user by primary email or activated email so commit will not be valid if email is not
if err != nil { // Skipping not user for commiter
committer = &User{
Name: c.Committer.Name,
Email: c.Committer.Email,
@ -645,14 +645,14 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
if c.Signature == nil {
return &CommitVerification{
CommittingUser: committer,
Verified: false, //Default value
Reason: "gpg.error.not_signed_commit", //Default value
Verified: false, // Default value
Reason: "gpg.error.not_signed_commit", // Default value
}
}
//Parsing signature
// Parsing signature
sig, err := extractSignature(c.Signature.Signature)
if err != nil { //Skipping failed to extract sign
if err != nil { // Skipping failed to extract sign
log.Error("SignatureRead err: %v", err)
return &CommitVerification{
CommittingUser: committer,
@ -688,7 +688,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
// Now try to associate the signature with the committer, if present
if committer.ID != 0 {
keys, err := ListGPGKeys(committer.ID, ListOptions{})
if err != nil { //Skipping failed to get gpg keys of user
if err != nil { // Skipping failed to get gpg keys of user
log.Error("ListGPGKeys: %v", err)
return &CommitVerification{
CommittingUser: committer,
@ -698,7 +698,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
}
for _, k := range keys {
//Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate
// Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate
canValidate := false
email := ""
for _, e := range k.Emails {
@ -709,7 +709,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
}
}
if !canValidate {
continue //Skip this key
continue // Skip this key
}
commitVerification := hashAndVerifyWithSubKeys(sig, c.Signature.Payload, k, committer, committer, email)
@ -753,7 +753,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
}
}
return &CommitVerification{ //Default at this stage
return &CommitVerification{ // Default at this stage
CommittingUser: committer,
Verified: false,
Warning: defaultReason != NoKeyFound,

10
models/gpg_key_test.go

@ -47,7 +47,7 @@ MkM/fdpyc2hY7Dl/+qFmN5MG5yGmMpQcX+RNNR222ibNC1D3wg==
key, err := checkArmoredGPGKeyString(testGPGArmor)
assert.NoError(t, err, "Could not parse a valid GPG public armored rsa key", key)
//TODO verify value of key
// TODO verify value of key
}
func TestCheckArmoredbrainpoolP256r1GPGKeyString(t *testing.T) {
@ -68,7 +68,7 @@ OyjLLnFQiVmq7kEA/0z0CQe3ZQiQIq5zrs7Nh1XRkFAo8GlU/SGC9XFFi722
key, err := checkArmoredGPGKeyString(testGPGArmor)
assert.NoError(t, err, "Could not parse a valid GPG public armored brainpoolP256r1 key", key)
//TODO verify value of key
// TODO verify value of key
}
func TestExtractSignature(t *testing.T) {
@ -167,19 +167,19 @@ committer Antoine GIRARD <sapk@sapk.fr> 1489013107 +0100
Unknown GPG key with good email
`
//Reading Sign
// Reading Sign
goodSig, err := extractSignature(testGoodSigArmor)
assert.NoError(t, err, "Could not parse a valid GPG armored signature", testGoodSigArmor)
badSig, err := extractSignature(testBadSigArmor)
assert.NoError(t, err, "Could not parse a valid GPG armored signature", testBadSigArmor)
//Generating hash of commit
// Generating hash of commit
goodHash, err := populateHash(goodSig.Hash, []byte(testGoodPayload))
assert.NoError(t, err, "Could not generate a valid hash of payload", testGoodPayload)
badHash, err := populateHash(badSig.Hash, []byte(testBadPayload))
assert.NoError(t, err, "Could not generate a valid hash of payload", testBadPayload)
//Verify
// Verify
err = verifySign(goodSig, goodHash, key)
assert.NoError(t, err, "Could not validate a good signature")
err = verifySign(badSig, badHash, key)

6
models/helper.go

@ -5,7 +5,7 @@
package models
func keysInt64(m map[int64]struct{}) []int64 {
var keys = make([]int64, 0, len(m))
keys := make([]int64, 0, len(m))
for k := range m {
keys = append(keys, k)
}
@ -13,7 +13,7 @@ func keysInt64(m map[int64]struct{}) []int64 {
}
func valuesRepository(m map[int64]*Repository) []*Repository {
var values = make([]*Repository, 0, len(m))
values := make([]*Repository, 0, len(m))
for _, v := range m {
values = append(values, v)
}
@ -21,7 +21,7 @@ func valuesRepository(m map[int64]*Repository) []*Repository {
}
func valuesUser(m map[int64]*User) []*User {
var values = make([]*User, 0, len(m))
values := make([]*User, 0, len(m))
for _, v := range m {
values = append(values, v)
}

1
models/helper_environment.go

@ -74,5 +74,4 @@ func FullPushingEnvironment(author, committer *User, repo *Repository, repoName
}
return environ
}

35
models/issue.go

@ -77,9 +77,11 @@ var (
issueTasksDonePat *regexp.Regexp
)
const issueTasksRegexpStr = `(^\s*[-*]\s\[[\sxX]\]\s.)|(\n\s*[-*]\s\[[\sxX]\]\s.)`
const issueTasksDoneRegexpStr = `(^\s*[-*]\s\[[xX]\]\s.)|(\n\s*[-*]\s\[[xX]\]\s.)`
const issueMaxDupIndexAttempts = 3
const (
issueTasksRegexpStr = `(^\s*[-*]\s\[[\sxX]\]\s.)|(\n\s*[-*]\s\[[\sxX]\]\s.)`
issueTasksDoneRegexpStr = `(^\s*[-*]\s\[[xX]\]\s.)|(\n\s*[-*]\s\[[xX]\]\s.)`
issueMaxDupIndexAttempts = 3
)
func init() {
issueTasksPat = regexp.MustCompile(issueTasksRegexpStr)
@ -714,7 +716,7 @@ func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error) {
return fmt.Errorf("loadRepo: %v", err)
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeChangeTitle,
Doer: doer,
Repo: issue.Repo,
@ -759,7 +761,7 @@ func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branc
if err := sess.Begin(); err != nil {
return err
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeDeleteBranch,
Doer: doer,
Repo: repo,
@ -914,7 +916,7 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) {
return err
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeMilestone,
Doer: doer,
Repo: opts.Repo,
@ -1083,7 +1085,7 @@ func getIssuesByIDs(e Engine, issueIDs []int64) ([]*Issue, error) {
}
func getIssueIDsByRepoID(e Engine, repoID int64) ([]int64, error) {
var ids = make([]int64, 0, 10)
ids := make([]int64, 0, 10)
err := e.Table("issue").Where("repo_id = ?", repoID).Find(&ids)
return ids, err
}
@ -1689,7 +1691,7 @@ func GetUserIssueStats(opts UserIssueStatsOptions) (*IssueStats, error) {
}
// GetRepoIssueStats returns number of open and closed repository issues by given filter mode.
func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen int64, numClosed int64) {
func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen, numClosed int64) {
countSession := func(isClosed, isPull bool, repoID int64) *xorm.Session {
sess := x.
Where("is_closed = ?", isClosed).
@ -1719,10 +1721,10 @@ func GetRepoIssueStats(repoID, uid int64, filterMode int, isPull bool) (numOpen
// SearchIssueIDsByKeyword search issues on database
func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int64, []int64, error) {
var repoCond = builder.In("repo_id", repoIDs)
var subQuery = builder.Select("id").From("issue").Where(repoCond)
repoCond := builder.In("repo_id", repoIDs)
subQuery := builder.Select("id").From("issue").Where(repoCond)
kw = strings.ToUpper(kw)
var cond = builder.And(
cond := builder.And(
repoCond,
builder.Or(
builder.Like{"UPPER(name)", kw},
@ -1738,8 +1740,8 @@ func SearchIssueIDsByKeyword(kw string, repoIDs []int64, limit, start int) (int6
),
)
var ids = make([]int64, 0, limit)
var res = make([]struct {
ids := make([]int64, 0, limit)
res := make([]struct {
ID int64
UpdatedUnix int64
}, 0, limit)
@ -1790,7 +1792,7 @@ func UpdateIssueByAPI(issue *Issue, doer *User) (statusChangeComment *Comment, t
titleChanged = currentIssue.Title != issue.Title
if titleChanged {
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeChangeTitle,
Doer: doer,
Repo: issue.Repo,
@ -1819,7 +1821,6 @@ func UpdateIssueByAPI(issue *Issue, doer *User) (statusChangeComment *Comment, t
// UpdateIssueDeadline updates an issue deadline and adds comments. Setting a deadline to 0 means deleting it.
func UpdateIssueDeadline(issue *Issue, deadlineUnix timeutil.TimeStamp, doer *User) (err error) {
// if the deadline hasn't changed do nothing
if issue.DeadlineUnix == deadlineUnix {
return nil
@ -1879,7 +1880,7 @@ func (issue *Issue) getBlockedByDependencies(e Engine) (issueDeps []*DependencyI
Join("INNER", "repository", "repository.id = issue.repo_id").
Join("INNER", "issue_dependency", "issue_dependency.dependency_id = issue.id").
Where("issue_id = ?", issue.ID).
//sort by repo id then created date, with the issues of the same repo at the beginning of the list
// sort by repo id then created date, with the issues of the same repo at the beginning of the list
OrderBy("CASE WHEN issue.repo_id = " + strconv.FormatInt(issue.RepoID, 10) + " THEN 0 ELSE issue.repo_id END, issue.created_unix DESC").
Find(&issueDeps)
}
@ -1891,7 +1892,7 @@ func (issue *Issue) getBlockingDependencies(e Engine) (issueDeps []*DependencyIn
Join("INNER", "repository", "repository.id = issue.repo_id").
Join("INNER", "issue_dependency", "issue_dependency.issue_id = issue.id").
Where("dependency_id = ?", issue.ID).
//sort by repo id then created date, with the issues of the same repo at the beginning of the list
// sort by repo id then created date, with the issues of the same repo at the beginning of the list
OrderBy("CASE WHEN issue.repo_id = " + strconv.FormatInt(issue.RepoID, 10) + " THEN 0 ELSE issue.repo_id END, issue.created_unix DESC").
Find(&issueDeps)
}

6
models/issue_assignees.go

@ -119,7 +119,7 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in
return false, nil, fmt.Errorf("loadRepo: %v", err)
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeAssignees,
Doer: doer,
Repo: issue.Repo,
@ -143,7 +143,6 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in
// toggles user assignee state in database
func toggleUserAssignee(e *xorm.Session, issue *Issue, assigneeID int64) (removed bool, err error) {
// Check if the user exists
assignee, err := getUserByID(e, assigneeID)
if err != nil {
@ -180,7 +179,6 @@ func toggleUserAssignee(e *xorm.Session, issue *Issue, assigneeID int64) (remove
// MakeIDsFromAPIAssigneesToAdd returns an array with all assignee IDs
func MakeIDsFromAPIAssigneesToAdd(oneAssignee string, multipleAssignees []string) (assigneeIDs []int64, err error) {
var requestAssignees []string
// Keeping the old assigning method for compatibility reasons
@ -188,7 +186,7 @@ func MakeIDsFromAPIAssigneesToAdd(oneAssignee string, multipleAssignees []string
requestAssignees = append(requestAssignees, oneAssignee)
}
//Prevent empty assignees
// Prevent empty assignees
if len(multipleAssignees) > 0 && multipleAssignees[0] != "" {
requestAssignees = append(requestAssignees, multipleAssignees...)
}

12
models/issue_comment.go

@ -267,7 +267,6 @@ func (c *Comment) AfterDelete() {
}
_, err := DeleteAttachmentsByComment(c.ID, true)
if err != nil {
log.Info("Could not delete files for comment %d on issue #%d: %s", c.ID, c.IssueID, err)
}
@ -391,7 +390,6 @@ func (c *Comment) LoadLabel() error {
// LoadProject if comment.Type is CommentTypeProject, then load project.
func (c *Comment) LoadProject() error {
if c.OldProjectID > 0 {
var oldProject Project
has, err := x.ID(c.OldProjectID).Get(&oldProject)
@ -813,7 +811,7 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin
return nil, err
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: commentType,
Doer: doer,
Repo: issue.Repo,
@ -828,7 +826,7 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin
}
// Creates issue dependency comment
func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dependentIssue *Issue, add bool) (err error) {
func createIssueDependencyComment(e *xorm.Session, doer *User, issue, dependentIssue *Issue, add bool) (err error) {
cType := CommentTypeAddDependency
if !add {
cType = CommentTypeRemoveDependency
@ -838,7 +836,7 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep
}
// Make two comments, one in each issue
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: cType,
Doer: doer,
Repo: issue.Repo,
@ -977,7 +975,7 @@ type FindCommentsOptions struct {
}
func (opts *FindCommentsOptions) toConds() builder.Cond {
var cond = builder.NewCond()
cond := builder.NewCond()
if opts.RepoID > 0 {
cond = cond.And(builder.Eq{"issue.repo_id": opts.RepoID})
}
@ -1149,7 +1147,7 @@ func findCodeComments(e Engine, opts FindCommentsOptions, issue *Issue, currentU
// Find all reviews by ReviewID
reviews := make(map[int64]*Review)
var ids = make([]int64, 0, len(comments))
ids := make([]int64, 0, len(comments))
for _, comment := range comments {
if comment.ReviewID != 0 {
ids = append(ids, comment.ReviewID)

80
models/issue_comment_list.go

@ -24,9 +24,9 @@ func (comments CommentList) loadPosters(e Engine) error {
posterIDs := comments.getPosterIDs()
posterMaps := make(map[int64]*User, len(posterIDs))
var left = len(posterIDs)
left := len(posterIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -53,7 +53,7 @@ func (comments CommentList) loadPosters(e Engine) error {
}
func (comments CommentList) getCommentIDs() []int64 {
var ids = make([]int64, 0, len(comments))
ids := make([]int64, 0, len(comments))
for _, comment := range comments {
ids = append(ids, comment.ID)
}
@ -61,7 +61,7 @@ func (comments CommentList) getCommentIDs() []int64 {
}
func (comments CommentList) getLabelIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if _, ok := ids[comment.LabelID]; !ok {
ids[comment.LabelID] = struct{}{}
@ -75,11 +75,11 @@ func (comments CommentList) loadLabels(e Engine) error {
return nil
}
var labelIDs = comments.getLabelIDs()
var commentLabels = make(map[int64]*Label, len(labelIDs))
var left = len(labelIDs)
labelIDs := comments.getLabelIDs()
commentLabels := make(map[int64]*Label, len(labelIDs))
left := len(labelIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -111,7 +111,7 @@ func (comments CommentList) loadLabels(e Engine) error {
}
func (comments CommentList) getMilestoneIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if _, ok := ids[comment.MilestoneID]; !ok {
ids[comment.MilestoneID] = struct{}{}
@ -131,9 +131,9 @@ func (comments CommentList) loadMilestones(e Engine) error {
}
milestoneMaps := make(map[int64]*Milestone, len(milestoneIDs))
var left = len(milestoneIDs)
left := len(milestoneIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -154,7 +154,7 @@ func (comments CommentList) loadMilestones(e Engine) error {
}
func (comments CommentList) getOldMilestoneIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if _, ok := ids[comment.OldMilestoneID]; !ok {
ids[comment.OldMilestoneID] = struct{}{}
@ -174,9 +174,9 @@ func (comments CommentList) loadOldMilestones(e Engine) error {
}
milestoneMaps := make(map[int64]*Milestone, len(milestoneIDs))
var left = len(milestoneIDs)
left := len(milestoneIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -197,7 +197,7 @@ func (comments CommentList) loadOldMilestones(e Engine) error {
}
func (comments CommentList) getAssigneeIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if _, ok := ids[comment.AssigneeID]; !ok {
ids[comment.AssigneeID] = struct{}{}
@ -211,11 +211,11 @@ func (comments CommentList) loadAssignees(e Engine) error {
return nil
}
var assigneeIDs = comments.getAssigneeIDs()
var assignees = make(map[int64]*User, len(assigneeIDs))
var left = len(assigneeIDs)
assigneeIDs := comments.getAssigneeIDs()
assignees := make(map[int64]*User, len(assigneeIDs))
left := len(assigneeIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -250,7 +250,7 @@ func (comments CommentList) loadAssignees(e Engine) error {
// getIssueIDs returns all the issue ids on this comment list which issue hasn't been loaded
func (comments CommentList) getIssueIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if comment.Issue != nil {
continue
@ -264,7 +264,7 @@ func (comments CommentList) getIssueIDs() []int64 {
// Issues returns all the issues of comments
func (comments CommentList) Issues() IssueList {
var issues = make(map[int64]*Issue, len(comments))
issues := make(map[int64]*Issue, len(comments))
for _, comment := range comments {
if comment.Issue != nil {
if _, ok := issues[comment.Issue.ID]; !ok {
@ -273,7 +273,7 @@ func (comments CommentList) Issues() IssueList {
}
}
var issueList = make([]*Issue, 0, len(issues))
issueList := make([]*Issue, 0, len(issues))
for _, issue := range issues {
issueList = append(issueList, issue)
}
@ -285,11 +285,11 @@ func (comments CommentList) loadIssues(e Engine) error {
return nil
}
var issueIDs = comments.getIssueIDs()
var issues = make(map[int64]*Issue, len(issueIDs))
var left = len(issueIDs)
issueIDs := comments.getIssueIDs()
issues := make(map[int64]*Issue, len(issueIDs))
left := len(issueIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -325,7 +325,7 @@ func (comments CommentList) loadIssues(e Engine) error {
}
func (comments CommentList) getDependentIssueIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if comment.DependentIssue != nil {
continue
@ -342,11 +342,11 @@ func (comments CommentList) loadDependentIssues(e Engine) error {
return nil
}
var issueIDs = comments.getDependentIssueIDs()
var issues = make(map[int64]*Issue, len(issueIDs))
var left = len(issueIDs)
issueIDs := comments.getDependentIssueIDs()
issues := make(map[int64]*Issue, len(issueIDs))
left := len(issueIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -391,11 +391,11 @@ func (comments CommentList) loadAttachments(e Engine) (err error) {
return nil
}
var attachments = make(map[int64][]*Attachment, len(comments))
var commentsIDs = comments.getCommentIDs()
var left = len(commentsIDs)
attachments := make(map[int64][]*Attachment, len(comments))
commentsIDs := comments.getCommentIDs()
left := len(commentsIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -429,7 +429,7 @@ func (comments CommentList) loadAttachments(e Engine) (err error) {
}
func (comments CommentList) getReviewIDs() []int64 {
var ids = make(map[int64]struct{}, len(comments))
ids := make(map[int64]struct{}, len(comments))
for _, comment := range comments {
if _, ok := ids[comment.ReviewID]; !ok {
ids[comment.ReviewID] = struct{}{}
@ -443,11 +443,11 @@ func (comments CommentList) loadReviews(e Engine) error {
return nil
}
var reviewIDs = comments.getReviewIDs()
var reviews = make(map[int64]*Review, len(reviewIDs))
var left = len(reviewIDs)
reviewIDs := comments.getReviewIDs()
reviews := make(map[int64]*Review, len(reviewIDs))
left := len(reviewIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}

4
models/issue_dependency.go

@ -71,7 +71,7 @@ func CreateIssueDependency(user *User, issue, dep *Issue) error {
}
// RemoveIssueDependency removes a dependency from an issue
func RemoveIssueDependency(user *User, issue *Issue, dep *Issue, depType DependencyType) (err error) {
func RemoveIssueDependency(user *User, issue, dep *Issue, depType DependencyType) (err error) {
sess := x.NewSession()
defer sess.Close()
if err = sess.Begin(); err != nil {
@ -107,7 +107,7 @@ func RemoveIssueDependency(user *User, issue *Issue, dep *Issue, depType Depende
}
// Check if the dependency already exists
func issueDepExists(e Engine, issueID int64, depID int64) (bool, error) {
func issueDepExists(e Engine, issueID, depID int64) (bool, error) {
return e.Where("(issue_id = ? AND dependency_id = ?)", issueID, depID).Exist(&IssueDependency{})
}

5
models/issue_label.go

@ -256,7 +256,6 @@ func UpdateLabel(l *Label) error {
// DeleteLabel delete a label
func DeleteLabel(id, labelID int64) error {
label, err := GetLabelByID(labelID)
if err != nil {
if IsErrLabelNotExist(err) {
@ -646,7 +645,7 @@ func newIssueLabel(e *xorm.Session, issue *Issue, label *Label, doer *User) (err
return
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeLabel,
Doer: doer,
Repo: issue.Repo,
@ -748,7 +747,7 @@ func deleteIssueLabel(e *xorm.Session, issue *Issue, label *Label, doer *User) (
return
}
var opts = &CreateCommentOptions{
opts := &CreateCommentOptions{
Type: CommentTypeLabel,
Doer: doer,
Repo: issue.Repo,

1
models/issue_label_test.go

@ -231,7 +231,6 @@ func TestGetLabelsByOrgID(t *testing.T) {
_, err = GetLabelsByOrgID(-1, "leastissues", ListOptions{})
assert.True(t, IsErrOrgLabelNotExist(err))
}
//

62
models/issue_list.go

@ -35,9 +35,9 @@ func (issues IssueList) loadRepositories(e Engine) ([]*Repository, error) {
repoIDs := issues.getRepoIDs()
repoMaps := make(map[int64]*Repository, len(repoIDs))
var left = len(repoIDs)
left := len(repoIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -79,9 +79,9 @@ func (issues IssueList) loadPosters(e Engine) error {
posterIDs := issues.getPosterIDs()
posterMaps := make(map[int64]*User, len(posterIDs))
var left = len(posterIDs)
left := len(posterIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -108,7 +108,7 @@ func (issues IssueList) loadPosters(e Engine) error {
}
func (issues IssueList) getIssueIDs() []int64 {
var ids = make([]int64, 0, len(issues))
ids := make([]int64, 0, len(issues))
for _, issue := range issues {
ids = append(ids, issue.ID)
}
@ -125,11 +125,11 @@ func (issues IssueList) loadLabels(e Engine) error {
IssueLabel *IssueLabel `xorm:"extends"`
}
var issueLabels = make(map[int64][]*Label, len(issues)*3)
var issueIDs = issues.getIssueIDs()
var left = len(issueIDs)
issueLabels := make(map[int64][]*Label, len(issues)*3)
issueIDs := issues.getIssueIDs()
left := len(issueIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -169,7 +169,7 @@ func (issues IssueList) loadLabels(e Engine) error {
}
func (issues IssueList) getMilestoneIDs() []int64 {
var ids = make(map[int64]struct{}, len(issues))
ids := make(map[int64]struct{}, len(issues))
for _, issue := range issues {
if _, ok := ids[issue.MilestoneID]; !ok {
ids[issue.MilestoneID] = struct{}{}
@ -185,9 +185,9 @@ func (issues IssueList) loadMilestones(e Engine) error {
}
milestoneMaps := make(map[int64]*Milestone, len(milestoneIDs))
var left = len(milestoneIDs)
left := len(milestoneIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -217,11 +217,11 @@ func (issues IssueList) loadAssignees(e Engine) error {
Assignee *User `xorm:"extends"`
}
var assignees = make(map[int64][]*User, len(issues))
var issueIDs = issues.getIssueIDs()
var left = len(issueIDs)
assignees := make(map[int64][]*User, len(issues))
issueIDs := issues.getIssueIDs()
left := len(issueIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -259,7 +259,7 @@ func (issues IssueList) loadAssignees(e Engine) error {
}
func (issues IssueList) getPullIssueIDs() []int64 {
var ids = make([]int64, 0, len(issues))
ids := make([]int64, 0, len(issues))
for _, issue := range issues {
if issue.IsPull && issue.PullRequest == nil {
ids = append(ids, issue.ID)
@ -275,9 +275,9 @@ func (issues IssueList) loadPullRequests(e Engine) error {
}
pullRequestMaps := make(map[int64]*PullRequest, len(issuesIDs))
var left = len(issuesIDs)
left := len(issuesIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -317,11 +317,11 @@ func (issues IssueList) loadAttachments(e Engine) (err error) {
return nil
}
var attachments = make(map[int64][]*Attachment, len(issues))
var issuesIDs = issues.getIssueIDs()
var left = len(issuesIDs)
attachments := make(map[int64][]*Attachment, len(issues))
issuesIDs := issues.getIssueIDs()
left := len(issuesIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -362,11 +362,11 @@ func (issues IssueList) loadComments(e Engine, cond builder.Cond) (err error) {
return nil
}
var comments = make(map[int64][]*Comment, len(issues))
var issuesIDs = issues.getIssueIDs()
var left = len(issuesIDs)
comments := make(map[int64][]*Comment, len(issues))
issuesIDs := issues.getIssueIDs()
left := len(issuesIDs)
for left > 0 {
var limit = defaultMaxInSize
limit := defaultMaxInSize
if left < limit {
limit = left
}
@ -411,18 +411,18 @@ func (issues IssueList) loadTotalTrackedTimes(e Engine) (err error) {
if len(issues) == 0 {
return nil
}