[release-10.4.18] Go: Bump to 1.24.2 (#103531)
* Go: Bump to 1.24.2 * CI: Update golangci-lint * feat: update swagger * fix: more lints * fix: lints
This commit is contained in:
@@ -445,6 +445,7 @@ func (ss *sqlStore) GetFolders(ctx context.Context, q getFoldersQuery) ([]*folde
|
||||
|
||||
var folders []*folder.Folder
|
||||
if err := ss.db.WithDbSession(ctx, func(sess *db.Session) error {
|
||||
//nolint:gosec // G115
|
||||
return batch(len(q.UIDs), int(q.BatchSize), func(start, end int) error {
|
||||
partialFolders := make([]*folder.Folder, 0, q.BatchSize)
|
||||
partialUIDs := q.UIDs[start:min(end, len(q.UIDs))]
|
||||
@@ -483,6 +484,7 @@ func (ss *sqlStore) GetFolders(ctx context.Context, q getFoldersQuery) ([]*folde
|
||||
}
|
||||
|
||||
// filter out folders if they are not in the subtree of the given ancestor folders
|
||||
//nolint:gosec // G115
|
||||
if err := batch(len(q.ancestorUIDs), int(q.BatchSize), func(start2, end2 int) error {
|
||||
s2, args2 := getAncestorsSQL(ss.db.GetDialect(), q.ancestorUIDs, start2, end2, s.String(), args)
|
||||
err := sess.SQL(s2, args2...).Find(&partialFolders)
|
||||
|
||||
@@ -864,7 +864,9 @@ func TestIntegrationGetFolders(t *testing.T) {
|
||||
|
||||
t.Run("get folders by UIDs and ancestor UIDs should work as expected", func(t *testing.T) {
|
||||
q := NewGetFoldersQuery(folder.GetFoldersQuery{OrgID: orgID, UIDs: uids[1:], BatchSize: 3})
|
||||
//nolint:gosec // G115
|
||||
q.ancestorUIDs = make([]string, 0, int(q.BatchSize)+1)
|
||||
//nolint:gosec // G115
|
||||
for i := 0; i < int(q.BatchSize); i++ {
|
||||
q.ancestorUIDs = append(q.ancestorUIDs, uuid.New().String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user