From f2e7d5477f076789da5d0e95fe61a56ddb939f5a Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Wed, 22 Sep 2021 13:38:34 +0800 Subject: refactor: move from io/ioutil to io and os package (#17109) 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 Co-authored-by: techknowlogick --- models/db/unit_tests.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'models/db') diff --git a/models/db/unit_tests.go b/models/db/unit_tests.go index 8d834fe118..0540c9ba8a 100644 --- a/models/db/unit_tests.go +++ b/models/db/unit_tests.go @@ -6,7 +6,6 @@ package db import ( "fmt" - "io/ioutil" "math" "net/url" "os" @@ -57,11 +56,11 @@ func MainTest(m *testing.M, pathToGiteaRoot string) { setting.SSH.Port = 3000 setting.SSH.Domain = "try.gitea.io" setting.Database.UseSQLite3 = true - setting.RepoRootPath, err = ioutil.TempDir(os.TempDir(), "repos") + setting.RepoRootPath, err = os.MkdirTemp(os.TempDir(), "repos") if err != nil { fatalTestError("TempDir: %v\n", err) } - setting.AppDataPath, err = ioutil.TempDir(os.TempDir(), "appdata") + setting.AppDataPath, err = os.MkdirTemp(os.TempDir(), "appdata") if err != nil { fatalTestError("TempDir: %v\n", err) } -- cgit v1.2.3