Replace ioutil with io and os (#5498)
This commit is contained in:
parent
6edb4ecdbb
commit
58cb773e09
155 changed files with 1165 additions and 1197 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue