@@ -14,7 +14,7 @@ func createTestGoModule(root string) error {
1414go 1.21
1515`
1616 goModPath := filepath .Join (root , "go.mod" )
17- if err := os .WriteFile (goModPath , []byte (goModContent ), 0644 ); err != nil {
17+ if err := os .WriteFile (goModPath , []byte (goModContent ), internal . PermFile ); err != nil {
1818 return err
1919 }
2020
@@ -40,7 +40,7 @@ func TestSomething(t *testing.T) {
4040 t.Log("This is a regular test")
4141}
4242`
43- if err := os .WriteFile (testFile , []byte (testContent ), 0644 ); err != nil {
43+ if err := os .WriteFile (testFile , []byte (testContent ), internal . PermFile ); err != nil {
4444 return err
4545 }
4646
@@ -61,7 +61,7 @@ func BenchmarkSubProcessor(b *testing.B) {
6161 }
6262}
6363`
64- if err := os .WriteFile (subTestFile , []byte (subTestContent ), 0644 ); err != nil {
64+ if err := os .WriteFile (subTestFile , []byte (subTestContent ), internal . PermFile ); err != nil {
6565 return err
6666 }
6767
@@ -78,19 +78,13 @@ func cleanupBenchDirectories() {
7878
7979 // Remove the entire bench directory if it exists in current directory
8080 benchDir := filepath .Join (currentDir , internal .MainDirOutput )
81- if err := os .RemoveAll (benchDir ); err != nil {
82- // Ignore errors during cleanup - file might not exist
83- }
81+ os .RemoveAll (benchDir )
8482
8583 // Also try to clean up in the tests subdirectory if we're running from there
8684 testsBenchDir := filepath .Join (currentDir , "tests" , internal .MainDirOutput )
87- if err := os .RemoveAll (testsBenchDir ); err != nil {
88- // Ignore errors during cleanup - file might not exist
89- }
85+ os .RemoveAll (testsBenchDir )
9086
9187 // Try to clean up in the benchmark package directory
9288 benchmarkBenchDir := filepath .Join (currentDir , "engine" , "benchmark" , "tests" , internal .MainDirOutput )
93- if err := os .RemoveAll (benchmarkBenchDir ); err != nil {
94- // Ignore errors during cleanup - file might not exist
95- }
89+ os .RemoveAll (benchmarkBenchDir )
9690}
0 commit comments