diff options
| author | Russ Cox <rsc@golang.org> | 2011-11-01 22:05:34 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-11-01 22:05:34 -0400 |
| commit | eb6929299b6da3d9bea1fa7f7cd319c2de9242bb (patch) | |
| tree | d3309a8985202985334709bc50e1a737ea117593 /src/pkg/patch/textdiff.go | |
| parent | c2049d2dfeeea3d41fafa91e3e3f0e47c285355b (diff) | |
| download | go-eb6929299b6da3d9bea1fa7f7cd319c2de9242bb.tar.xz | |
src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
Diffstat (limited to 'src/pkg/patch/textdiff.go')
| -rw-r--r-- | src/pkg/patch/textdiff.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/patch/textdiff.go b/src/pkg/patch/textdiff.go index 482bd67816..adb629a293 100644 --- a/src/pkg/patch/textdiff.go +++ b/src/pkg/patch/textdiff.go @@ -2,7 +2,7 @@ package patch import ( "bytes" - "os" + "errors" ) type TextDiff []TextChunk @@ -16,7 +16,7 @@ type TextChunk struct { New []byte } -func ParseTextDiff(raw []byte) (TextDiff, os.Error) { +func ParseTextDiff(raw []byte) (TextDiff, error) { var chunkHeader []byte // Copy raw so it is safe to keep references to slices. @@ -151,11 +151,11 @@ ErrChunkHdr: return nil, SyntaxError("unexpected chunk header line: " + string(chunkHeader)) } -var ErrPatchFailure = os.NewError("patch did not apply cleanly") +var ErrPatchFailure = errors.New("patch did not apply cleanly") // Apply applies the changes listed in the diff // to the data, returning the new version. -func (d TextDiff) Apply(data []byte) ([]byte, os.Error) { +func (d TextDiff) Apply(data []byte) ([]byte, error) { var buf bytes.Buffer line := 1 for _, c := range d { |
