feat: upgrade golangci-lint to 1.45.2
This commit is contained in:
@ -49,7 +49,7 @@ func ExportUserData(s *xorm.Session, u *user.User) (err error) {
|
||||
// Open zip
|
||||
dumpFile, err := os.Create(tmpFilename)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error opening dump file: %s", err)
|
||||
return fmt.Errorf("error opening dump file: %w", err)
|
||||
}
|
||||
defer dumpFile.Close()
|
||||
|
||||
|
@ -216,7 +216,7 @@ func duplicateTasks(s *xorm.Session, doer web.Auth, ld *ListDuplicate, bucketMap
|
||||
// It is used to map old task items to new ones.
|
||||
taskMap := make(map[int64]int64)
|
||||
// Create + update all tasks (includes reminders)
|
||||
oldTaskIDs := make([]int64, len(tasks))
|
||||
oldTaskIDs := make([]int64, 0, len(tasks))
|
||||
for _, t := range tasks {
|
||||
oldID := t.ID
|
||||
t.ID = 0
|
||||
|
@ -402,7 +402,7 @@ func getRawTasksForLists(s *xorm.Session, lists []*List, a web.Auth, opts *taskO
|
||||
return nil, 0, 0, err
|
||||
}
|
||||
|
||||
userListIDs := make([]int64, len(userLists))
|
||||
userListIDs := make([]int64, 0, len(userLists))
|
||||
for _, l := range userLists {
|
||||
userListIDs = append(userListIDs, l.ID)
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ func ListUsersFromList(s *xorm.Session, l *List, search string) (users []*user.U
|
||||
uidmap[u.TeamNamespaceUserID] = true
|
||||
}
|
||||
|
||||
uids := make([]int64, len(uidmap))
|
||||
uids := make([]int64, 0, len(uidmap))
|
||||
for id := range uidmap {
|
||||
uids = append(uids, id)
|
||||
}
|
||||
|
Reference in New Issue
Block a user