@@ -48,7 +48,7 @@ func TestWithLowOpenFileLimit(t *testing.T) {
48
48
)
49
49
t .Logf ("writing %d tiny Go files" , numberFilesTotal )
50
50
var allGoFiles []string
51
- for i := 0 ; i < numberDirs ; i ++ {
51
+ for i := range numberDirs {
52
52
// Prefix "p", so the package name is a valid identifier.
53
53
// Add one go.mod file per directory as well,
54
54
// which will help catch data races when loading module info.
@@ -58,14 +58,14 @@ func TestWithLowOpenFileLimit(t *testing.T) {
58
58
qt .Assert (t , qt .IsNil (err ))
59
59
60
60
err = os .WriteFile (filepath .Join (dirPath , "go.mod" ),
61
- [] byte ( fmt .Sprintf ( "module %s\n \n go 1.16" , dirName ) ), 0o666 )
61
+ fmt .Appendf ( nil , "module %s\n \n go 1.16" , dirName ), 0o666 )
62
62
qt .Assert (t , qt .IsNil (err ))
63
63
64
- for j := 0 ; j < numberFilesPerDir ; j ++ {
64
+ for j := range numberFilesPerDir {
65
65
filePath := filepath .Join (dirPath , fmt .Sprintf ("%03d.go" , j ))
66
66
err := os .WriteFile (filePath ,
67
67
// Extra newlines so that "-l" prints all paths.
68
- [] byte ( fmt .Sprintf ( "package %s\n \n \n " , dirName ) ), 0o666 )
68
+ fmt .Appendf ( nil , "package %s\n \n \n " , dirName ), 0o666 )
69
69
qt .Assert (t , qt .IsNil (err ))
70
70
allGoFiles = append (allGoFiles , filePath )
71
71
}
0 commit comments