@@ -2,7 +2,6 @@ package scmauth
22
33import (
44 "fmt"
5- "io/ioutil"
65 "os"
76 "path/filepath"
87 "strings"
@@ -17,13 +16,13 @@ var log = utillog.ToFile(os.Stderr, 2)
1716// section to the provided path.
1817// Returns the path to the git configuration file, and error if raised.
1918func createGitConfig (includePath string , context SCMAuthContext ) (string , error ) {
20- tempDir , err := ioutil . TempDir ("" , "git" )
19+ tempDir , err := os . MkdirTemp ("" , "git" )
2120 if err != nil {
2221 return "" , err
2322 }
2423 gitconfig := filepath .Join (tempDir , ".gitconfig" )
2524 content := fmt .Sprintf ("[include]\n path = %s\n " , includePath )
26- if err := ioutil .WriteFile (gitconfig , []byte (content ), 0600 ); err != nil {
25+ if err := os .WriteFile (gitconfig , []byte (content ), 0600 ); err != nil {
2726 return "" , err
2827 }
2928 // The GIT_CONFIG variable won't affect regular git operation
@@ -61,6 +60,6 @@ func ensureGitConfigIncludes(path string, context SCMAuthContext) (string, error
6160
6261 lines = append (lines , fmt .Sprintf ("path = %s" , path ))
6362 content := []byte (strings .Join (lines , "\n " ))
64- err = ioutil .WriteFile (gitconfig , content , 0600 )
63+ err = os .WriteFile (gitconfig , content , 0600 )
6564 return gitconfig , err
6665}
0 commit comments