summaryrefslogtreecommitdiffstats
path: root/models/asymkey
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-01-10 01:48:13 +0000
committerGitHub <noreply@github.com>2022-01-10 09:48:13 +0800
commit242dddfcb7cfab1d21c1658828d94f603809a5c7 (patch)
treeee10a755954c3f0a84d00d848a66333925357672 /models/asymkey
parent60b945565dc3ef587ec147927102fe1afaded140 (diff)
downloadgitea-242dddfcb7cfab1d21c1658828d94f603809a5c7.tar.gz
gitea-242dddfcb7cfab1d21c1658828d94f603809a5c7.zip
Remove `ioutil` (#18222)
- Don't use `ioutil` package anymore as it doesn't anything special anymore since Go 1.16: ``` // As of Go 1.16, the same functionality is now provided // by package io or package os, and those implementations // should be preferred in new code. ``` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'models/asymkey')
-rw-r--r--models/asymkey/ssh_key_test.go6
1 files changed, 3 insertions, 3 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