forked from forgejo/forgejo
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>
This commit is contained in:
parent
60b945565d
commit
242dddfcb7
3 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue