mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
refactor: move from io/ioutil to io and os package (#1772)
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -53,11 +52,11 @@ func TestDirExists(t *testing.T) {
|
||||
const st = "stash_tmp"
|
||||
|
||||
tmp := os.TempDir()
|
||||
tmpDir, err := ioutil.TempDir(tmp, st) // create a tmp dir in the system's tmp folder
|
||||
tmpDir, err := os.MkdirTemp(tmp, st) // create a tmp dir in the system's tmp folder
|
||||
if err == nil {
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
tmpFile, err := ioutil.TempFile(tmpDir, st)
|
||||
tmpFile, err := os.CreateTemp(tmpDir, st)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user