@@ -81,14 +81,11 @@ func TestTarLimits(t *testing.T) {
8181 t .Fatal (err )
8282 }
8383
84- td , err := os .MkdirTemp ("" , "getter" )
85- if err != nil {
86- t .Fatalf ("err: %s" , err )
87- }
84+ td := t .TempDir ()
8885
8986 tarFilePath := filepath .Join (td , "input.tar" )
9087
91- err = os .WriteFile (tarFilePath , b .Bytes (), 0666 )
88+ err : = os .WriteFile (tarFilePath , b .Bytes (), 0666 )
9289 if err != nil {
9390 t .Fatalf ("err: %s" , err )
9491 }
@@ -132,15 +129,12 @@ func TestTarLimits(t *testing.T) {
132129
133130// testDecompressPermissions decompresses a directory and checks the permissions of the expanded files
134131func testDecompressorPermissions (t * testing.T , d Decompressor , input string , expected map [string ]int , umask os.FileMode ) {
135- td , err := os .MkdirTemp ("" , "getter" )
136- if err != nil {
137- t .Fatalf ("err: %s" , err )
138- }
132+ td := t .TempDir ()
139133
140134 // Destination is always joining result so that we have a new path
141135 dst := filepath .Join (td , "subdir" , "result" )
142136
143- err = d .Decompress (dst , input , true , umask )
137+ err : = d .Decompress (dst , input , true , umask )
144138 if err != nil {
145139 t .Fatalf ("err: %s" , err )
146140 }
0 commit comments