mirror of
https://github.com/caddyserver/xcaddy.git
synced 2025-01-22 08:36:28 +01:00
Remove use of io/ioutil
This commit is contained in:
parent
e09becb9d1
commit
2b5d89d9e5
3 changed files with 3 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
linters-settings:
|
||||
errcheck:
|
||||
ignore: fmt:.*,io/ioutil:^Read.*
|
||||
ignore: fmt:.*:^Read.*
|
||||
ignoretests: true
|
||||
misspell:
|
||||
locale: US
|
||||
|
|
|
@ -17,7 +17,6 @@ package xcaddy
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
@ -227,7 +226,7 @@ func newTempFolder() (string, error) {
|
|||
}
|
||||
}
|
||||
ts := time.Now().Format(yearMonthDayHourMin)
|
||||
return ioutil.TempDir(parentDir, fmt.Sprintf("buildenv_%s.", ts))
|
||||
return os.MkdirTemp(parentDir, fmt.Sprintf("buildenv_%s.", ts))
|
||||
}
|
||||
|
||||
// versionedModulePath helps enforce Go Module's Semantic Import Versioning (SIV) by
|
||||
|
|
|
@ -18,7 +18,6 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
@ -87,7 +86,7 @@ func (b Builder) newEnvironment(ctx context.Context) (*environment, error) {
|
|||
// write the main module file to temporary folder
|
||||
mainPath := filepath.Join(tempFolder, "main.go")
|
||||
log.Printf("[INFO] Writing main module: %s\n%s", mainPath, buf.Bytes())
|
||||
err = ioutil.WriteFile(mainPath, buf.Bytes(), 0644)
|
||||
err = os.WriteFile(mainPath, buf.Bytes(), 0644)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue