mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-31 20:24:18 -04:00
chore: remove refs of deprecated io/ioutil (#5576)
This commit is contained in:
parent
3b19aa2b5a
commit
4548b7de8e
@ -18,7 +18,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -221,21 +220,21 @@ func TestNestedInclude(t *testing.T) {
|
|||||||
// create files and for test case
|
// create files and for test case
|
||||||
if test.parentFile != "" {
|
if test.parentFile != "" {
|
||||||
absFilePath = filepath.Join(fmt.Sprintf("%s", context.Root), test.parentFile)
|
absFilePath = filepath.Join(fmt.Sprintf("%s", context.Root), test.parentFile)
|
||||||
if err := ioutil.WriteFile(absFilePath, []byte(test.parent), os.ModePerm); err != nil {
|
if err := os.WriteFile(absFilePath, []byte(test.parent), os.ModePerm); err != nil {
|
||||||
os.Remove(absFilePath)
|
os.Remove(absFilePath)
|
||||||
t.Fatalf("Test %d: Expected no error creating file, got: '%s'", i, err.Error())
|
t.Fatalf("Test %d: Expected no error creating file, got: '%s'", i, err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if test.childFile != "" {
|
if test.childFile != "" {
|
||||||
absFilePath0 = filepath.Join(fmt.Sprintf("%s", context.Root), test.childFile)
|
absFilePath0 = filepath.Join(fmt.Sprintf("%s", context.Root), test.childFile)
|
||||||
if err := ioutil.WriteFile(absFilePath0, []byte(test.child), os.ModePerm); err != nil {
|
if err := os.WriteFile(absFilePath0, []byte(test.child), os.ModePerm); err != nil {
|
||||||
os.Remove(absFilePath0)
|
os.Remove(absFilePath0)
|
||||||
t.Fatalf("Test %d: Expected no error creating file, got: '%s'", i, err.Error())
|
t.Fatalf("Test %d: Expected no error creating file, got: '%s'", i, err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if test.child2File != "" {
|
if test.child2File != "" {
|
||||||
absFilePath1 = filepath.Join(fmt.Sprintf("%s", context.Root), test.child2File)
|
absFilePath1 = filepath.Join(fmt.Sprintf("%s", context.Root), test.child2File)
|
||||||
if err := ioutil.WriteFile(absFilePath1, []byte(test.child2), os.ModePerm); err != nil {
|
if err := os.WriteFile(absFilePath1, []byte(test.child2), os.ModePerm); err != nil {
|
||||||
os.Remove(absFilePath0)
|
os.Remove(absFilePath0)
|
||||||
t.Fatalf("Test %d: Expected no error creating file, got: '%s'", i, err.Error())
|
t.Fatalf("Test %d: Expected no error creating file, got: '%s'", i, err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user