@@ -7,7 +7,6 @@ package integrations
7
7
import (
8
8
"context"
9
9
"fmt"
10
- "io/ioutil"
11
10
"net"
12
11
"net/http"
13
12
"net/url"
@@ -28,7 +27,7 @@ import (
28
27
29
28
func withKeyFile (t * testing.T , keyname string , callback func (string )) {
30
29
31
- tmpDir , err := ioutil . TempDir ("" , "key-file" )
30
+ tmpDir , err := os . MkdirTemp ("" , "key-file" )
32
31
assert .NoError (t , err )
33
32
defer util .RemoveAll (tmpDir )
34
33
@@ -39,7 +38,7 @@ func withKeyFile(t *testing.T, keyname string, callback func(string)) {
39
38
err = ssh .GenKeyPair (keyFile )
40
39
assert .NoError (t , err )
41
40
42
- err = ioutil .WriteFile (path .Join (tmpDir , "ssh" ), []byte ("#!/bin/bash\n " +
41
+ err = os .WriteFile (path .Join (tmpDir , "ssh" ), []byte ("#!/bin/bash\n " +
43
42
"ssh -o \" UserKnownHostsFile=/dev/null\" -o \" StrictHostKeyChecking=no\" -o \" IdentitiesOnly=yes\" -i \" " + keyFile + "\" \" $@\" " ), 0700 )
44
43
assert .NoError (t , err )
45
44
@@ -125,7 +124,7 @@ func doGitClone(dstLocalPath string, u *url.URL) func(*testing.T) {
125
124
126
125
func doGitCloneFail (u * url.URL ) func (* testing.T ) {
127
126
return func (t * testing.T ) {
128
- tmpDir , err := ioutil . TempDir ("" , "doGitCloneFail" )
127
+ tmpDir , err := os . MkdirTemp ("" , "doGitCloneFail" )
129
128
assert .NoError (t , err )
130
129
defer util .RemoveAll (tmpDir )
131
130
assert .Error (t , git .Clone (u .String (), tmpDir , git.CloneRepoOptions {}))
@@ -139,7 +138,7 @@ func doGitInitTestRepository(dstPath string) func(*testing.T) {
139
138
return func (t * testing.T ) {
140
139
// Init repository in dstPath
141
140
assert .NoError (t , git .InitRepository (dstPath , false ))
142
- assert .NoError (t , ioutil .WriteFile (filepath .Join (dstPath , "README.md" ), []byte (fmt .Sprintf ("# Testing Repository\n \n Originally created in: %s" , dstPath )), 0644 ))
141
+ assert .NoError (t , os .WriteFile (filepath .Join (dstPath , "README.md" ), []byte (fmt .Sprintf ("# Testing Repository\n \n Originally created in: %s" , dstPath )), 0644 ))
143
142
assert .NoError (t , git .AddChanges (dstPath , true ))
144
143
signature := git.Signature {
145
144
0 commit comments