File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change 11package fs
22
33import (
4+ "maps"
45 "strconv"
56 "testing"
67
@@ -465,10 +466,7 @@ func TestBlkioStatsNoFilesBFQDebug(t *testing.T) {
465466 for _ , testCase := range testCases {
466467 path := tempDir (t , "cpuset" )
467468
468- tempBlkioTestFiles := map [string ]string {}
469- for i , v := range blkioBFQDebugStatsTestFiles {
470- tempBlkioTestFiles [i ] = v
471- }
469+ tempBlkioTestFiles := maps .Clone (blkioBFQDebugStatsTestFiles )
472470 delete (tempBlkioTestFiles , testCase .filename )
473471
474472 writeFileContents (t , path , tempBlkioTestFiles )
@@ -579,10 +577,7 @@ func TestBlkioStatsNoFilesCFQ(t *testing.T) {
579577 for _ , testCase := range testCases {
580578 path := tempDir (t , "cpuset" )
581579
582- tempBlkioTestFiles := map [string ]string {}
583- for i , v := range blkioCFQStatsTestFiles {
584- tempBlkioTestFiles [i ] = v
585- }
580+ tempBlkioTestFiles := maps .Clone (blkioCFQStatsTestFiles )
586581 delete (tempBlkioTestFiles , testCase .filename )
587582
588583 writeFileContents (t , path , tempBlkioTestFiles )
Original file line number Diff line number Diff line change 11package fs
22
33import (
4+ "maps"
45 "reflect"
56 "testing"
67
@@ -211,10 +212,7 @@ func TestCPUSetStatsMissingFiles(t *testing.T) {
211212 t .Run (testCase .desc , func (t * testing.T ) {
212213 path := tempDir (t , "cpuset" )
213214
214- tempCpusetTestFiles := map [string ]string {}
215- for i , v := range cpusetTestFiles {
216- tempCpusetTestFiles [i ] = v
217- }
215+ tempCpusetTestFiles := maps .Clone (cpusetTestFiles )
218216
219217 if testCase .removeFile {
220218 delete (tempCpusetTestFiles , testCase .filename )
You can’t perform that action at this time.
0 commit comments