diff options
| author | Rob Pike <r@golang.org> | 2009-12-02 22:02:14 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-12-02 22:02:14 -0800 |
| commit | 9599e35e75f3bf5223edd9b0a0854536c23cdef2 (patch) | |
| tree | c8ce48aeddfe892be3754b0aa74217b4eb6d1e57 /src/cmd/hgpatch | |
| parent | 0247d93d819700b0bfc6814dc7b1c2afec4648a0 (diff) | |
| download | golang-9599e35e75f3bf5223edd9b0a0854536c23cdef2.tar.gz | |
move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.
this breaks the dependency of package io on package bytes.
R=rsc
CC=golang-dev
http://codereview.appspot.com/163085
Diffstat (limited to 'src/cmd/hgpatch')
| -rw-r--r-- | src/cmd/hgpatch/main.go | 9 |
1 files changed, 5 insertions, 4 deletions
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 { |
