Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(88)

Delta Between Two Patch Sets: src/pkg/os/error.go

Issue 4607052: code review 4607052: os.Error API: don't export os.ErrorString, use os.NewEr... (Closed)
Left Patch Set: diff -r 3a5f42c956e0 https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Right Patch Set: diff -r 6e3e06fb2dc3 https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/netchan/import.go ('k') | src/pkg/rand/rand_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package os 5 package os
6 6
7 // An Error can represent any printable error condition. 7 // An Error can represent any printable error condition.
8 type Error interface { 8 type Error interface {
9 String() string 9 String() string
10 } 10 }
11 11
12 // errorString is a helper type used by NewError. 12 // // errorString is a helper type used by NewError.
13 type errorString string 13 type errorString string
14 14
15 func (e errorString) String() string { return string(e) } 15 func (e errorString) String() string { return string(e) }
16 16
17 // Note: If the name of the function NewError changes, 17 // Note: If the name of the function NewError changes,
18 // pkg/go/doc/doc.go should be adjusted since it hardwires 18 // pkg/go/doc/doc.go should be adjusted since it hardwires
19 // this name in a heuristic. 19 // this name in a heuristic.
20 20
21 // NewError returns a new error with error.String() == s. 21 // // NewError returns a new error with error.String() == s.
22 func NewError(s string) Error { return errorString(s) } 22 func NewError(s string) Error { return errorString(s) }
23 23
24 // PathError records an error and the operation and file path that caused it. 24 // PathError records an error and the operation and file path that caused it.
25 type PathError struct { 25 type PathError struct {
26 Op string 26 Op string
27 Path string 27 Path string
28 Error Error 28 Error Error
29 } 29 }
30 30
31 func (e *PathError) String() string { return e.Op + " " + e.Path + ": " + e.Erro r.String() } 31 func (e *PathError) String() string { return e.Op + " " + e.Path + ": " + e.Erro r.String() }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b