summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/asymkey/ssh_key_test.go6
-rw-r--r--models/migrations/migrations_test.go3
-rw-r--r--modules/updatechecker/update_checker.go4
3 files changed, 6 insertions, 7 deletions
diff --git a/models/asymkey/ssh_key_test.go b/models/asymkey/ssh_key_test.go
index 54d299056b..71c8860f1c 100644
--- a/models/asymkey/ssh_key_test.go
+++ b/models/asymkey/ssh_key_test.go
@@ -7,7 +7,7 @@ package asymkey
import (
"bytes"
- "io/ioutil"
+ "os"
"os/exec"
"path/filepath"
"strings"
@@ -325,7 +325,7 @@ func TestFromOpenSSH(t *testing.T) {
sigPath := dataPath + ".sig"
run(t, nil, "ssh-keygen", "-Y", "sign", "-n", "file", "-f", privPath, dataPath)
- sigBytes, err := ioutil.ReadFile(sigPath)
+ sigBytes, err := os.ReadFile(sigPath)
if err != nil {
t.Fatal(err)
}
@@ -467,7 +467,7 @@ func TestRoundTrip(t *testing.T) {
func write(t *testing.T, d []byte, fp ...string) string {
p := filepath.Join(fp...)
- if err := ioutil.WriteFile(p, d, 0o600); err != nil {
+ if err := os.WriteFile(p, d, 0o600); err != nil {
t.Fatal(err)
}
return p
diff --git a/models/migrations/migrations_test.go b/models/migrations/migrations_test.go
index ceef0954e1..33d589ddb2 100644
--- a/models/migrations/migrations_test.go
+++ b/models/migrations/migrations_test.go
@@ -8,7 +8,6 @@ import (
"context"
"database/sql"
"fmt"
- "io/ioutil"
"os"
"path"
"path/filepath"
@@ -58,7 +57,7 @@ func TestMain(m *testing.M) {
setting.CustomConf = giteaConf
}
- tmpDataPath, err := ioutil.TempDir("", "data")
+ tmpDataPath, err := os.MkdirTemp("", "data")
if err != nil {
fmt.Printf("Unable to create temporary data path %v\n", err)
os.Exit(1)
diff --git a/modules/updatechecker/update_checker.go b/modules/updatechecker/update_checker.go
index 6c43309c1e..149a8462f6 100644
--- a/modules/updatechecker/update_checker.go
+++ b/modules/updatechecker/update_checker.go
@@ -5,7 +5,7 @@
package updatechecker
import (
- "io/ioutil"
+ "io"
"net/http"
"code.gitea.io/gitea/modules/appstate"
@@ -43,7 +43,7 @@ func GiteaUpdateChecker(httpEndpoint string) error {
return err
}
defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
if err != nil {
return err
}