Replace ioutil with io and os (#5498)

This commit is contained in:
Håvard Anda Estensen 2022-04-26 13:07:44 +02:00 committed by GitHub
parent 6edb4ecdbb
commit 58cb773e09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 1165 additions and 1197 deletions

View file

@ -40,9 +40,9 @@ func run(args []string) error {
return fmt.Errorf("error: --doc-path not set")
}
io, _, _, _ := iostreams.Test()
ios, _, _, _ := iostreams.Test()
rootCmd := root.NewCmdRoot(&cmdutil.Factory{
IOStreams: io,
IOStreams: ios,
Browser: &browser{},
}, "", "")
rootCmd.InitDefaultHelpCmd()

View file

@ -1,7 +1,7 @@
package main
import (
"io/ioutil"
"os"
"strings"
"testing"
)
@ -14,7 +14,7 @@ func Test_run(t *testing.T) {
t.Fatalf("got error: %v", err)
}
manPage, err := ioutil.ReadFile(dir + "/gh-issue-create.1")
manPage, err := os.ReadFile(dir + "/gh-issue-create.1")
if err != nil {
t.Fatalf("error reading `gh-issue-create.1`: %v", err)
}
@ -22,7 +22,7 @@ func Test_run(t *testing.T) {
t.Fatal("man page corrupted")
}
markdownPage, err := ioutil.ReadFile(dir + "/gh_issue_create.md")
markdownPage, err := os.ReadFile(dir + "/gh_issue_create.md")
if err != nil {
t.Fatalf("error reading `gh_issue_create.md`: %v", err)
}