diff options
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/cgo/util.go | 6 | ||||
| -rw-r--r-- | src/cmd/ebnflint/ebnflint.go | 4 | ||||
| -rw-r--r-- | src/cmd/godoc/godoc.go | 11 | ||||
| -rw-r--r-- | src/cmd/gofmt/gofmt.go | 6 | ||||
| -rw-r--r-- | src/cmd/hgpatch/main.go | 9 |
5 files changed, 19 insertions, 17 deletions
diff --git a/src/cmd/cgo/util.go b/src/cmd/cgo/util.go index 53b3ef6a3..176e9528e 100644 --- a/src/cmd/cgo/util.go +++ b/src/cmd/cgo/util.go @@ -8,7 +8,7 @@ import ( "exec"; "fmt"; "go/token"; - "io"; + "io/ioutil"; "os"; ) @@ -57,11 +57,11 @@ func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) { }(); var xstdout []byte; // TODO(rsc): delete after 6g can take address of out parameter go func() { - xstdout, _ = io.ReadAll(r1); + xstdout, _ = ioutil.ReadAll(r1); r1.Close(); c <- true; }(); - stderr, _ = io.ReadAll(r2); + stderr, _ = ioutil.ReadAll(r2); r2.Close(); <-c; <-c; diff --git a/src/cmd/ebnflint/ebnflint.go b/src/cmd/ebnflint/ebnflint.go index bd0ea34b5..4904780a3 100644 --- a/src/cmd/ebnflint/ebnflint.go +++ b/src/cmd/ebnflint/ebnflint.go @@ -10,7 +10,7 @@ import ( "flag"; "fmt"; "go/scanner"; - "io"; + "io/ioutil"; "os"; "path"; "strings"; @@ -84,7 +84,7 @@ func main() { usage() } - src, err := io.ReadFile(filename); + src, err := ioutil.ReadFile(filename); if err != nil { scanner.PrintError(os.Stderr, err) } diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 5f86100cb..ec89d69a8 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -15,6 +15,7 @@ import ( "go/token"; "http"; "io"; + "io/ioutil"; "log"; "os"; pathutil "path"; @@ -192,7 +193,7 @@ func newDirTree(path, name string, depth, maxDepth int) *Directory { return &Directory{depth, path, name, "", nil} } - list, _ := io.ReadDir(path); // ignore errors + list, _ := ioutil.ReadDir(path); // ignore errors // determine number of subdirectories and package files ndirs := 0; @@ -633,7 +634,7 @@ var fmap = template.FormatterMap{ func readTemplate(name string) *template.Template { path := pathutil.Join(*tmplroot, name); - data, err := io.ReadFile(path); + data, err := ioutil.ReadFile(path); if err != nil { log.Exitf("ReadFile %s: %v", path, err) } @@ -718,7 +719,7 @@ func commentText(src []byte) (text string) { func serveHTMLDoc(c *http.Conn, r *http.Request, path string) { // get HTML body contents - src, err := io.ReadFile(path); + src, err := ioutil.ReadFile(path); if err != nil { log.Stderrf("%v", err); http.NotFound(c, r); @@ -815,7 +816,7 @@ func isTextFile(path string) bool { func serveTextFile(c *http.Conn, r *http.Request, path string) { - src, err := io.ReadFile(path); + src, err := ioutil.ReadFile(path); if err != nil { log.Stderrf("serveTextFile: %s", err) } @@ -834,7 +835,7 @@ func serveDirectory(c *http.Conn, r *http.Request, path string) { return } - list, err := io.ReadDir(path); + list, err := ioutil.ReadDir(path); if err != nil { http.NotFound(c, r); return; diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go index cea8d4d34..b3a96857d 100644 --- a/src/cmd/gofmt/gofmt.go +++ b/src/cmd/gofmt/gofmt.go @@ -12,7 +12,7 @@ import ( "go/parser"; "go/printer"; "go/scanner"; - "io"; + "io/ioutil"; "os"; pathutil "path"; "strings"; @@ -86,7 +86,7 @@ func isGoFile(d *os.Dir) bool { func processFile(f *os.File) os.Error { - src, err := io.ReadAll(f); + src, err := ioutil.ReadAll(f); if err != nil { return err } @@ -112,7 +112,7 @@ func processFile(f *os.File) os.Error { fmt.Fprintln(os.Stdout, f.Name()) } if *write { - err = io.WriteFile(f.Name(), res.Bytes(), 0); + err = ioutil.WriteFile(f.Name(), res.Bytes(), 0); if err != nil { return err } diff --git a/src/cmd/hgpatch/main.go b/src/cmd/hgpatch/main.go index 96b5ef496..3d2b0817e 100644 --- a/src/cmd/hgpatch/main.go +++ b/src/cmd/hgpatch/main.go @@ -11,6 +11,7 @@ import ( "flag"; "fmt"; "io"; + "io/ioutil"; "os"; "patch"; "path"; @@ -35,9 +36,9 @@ func main() { var err os.Error; switch len(args) { case 0: - data, err = io.ReadAll(os.Stdin) + data, err = ioutil.ReadAll(os.Stdin) case 1: - data, err = io.ReadFile(args[0]) + data, err = ioutil.ReadFile(args[0]) default: usage() } @@ -87,7 +88,7 @@ func main() { } // Apply changes in memory. - op, err := pset.Apply(io.ReadFile); + op, err := pset.Apply(ioutil.ReadFile); chk(err); // Write changes to disk copy: order of commands matters. @@ -143,7 +144,7 @@ func main() { changed[o.Dst] = 1; } if o.Data != nil { - chk(io.WriteFile(o.Dst, o.Data, 0644)); + chk(ioutil.WriteFile(o.Dst, o.Data, 0644)); if o.Verb == patch.Add { undoRm(o.Dst) } else { |
