~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/os/error.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        String() string
10
10
}
11
11
 
12
 
// A helper type that can be embedded or wrapped to simplify satisfying
13
 
// Error.
14
 
type ErrorString string
 
12
// // errorString is a helper type used by NewError.
 
13
type errorString string
15
14
 
16
 
func (e ErrorString) String() string  { return string(e) }
17
 
func (e ErrorString) Temporary() bool { return false }
18
 
func (e ErrorString) Timeout() bool   { return false }
 
15
func (e errorString) String() string { return string(e) }
19
16
 
20
17
// Note: If the name of the function NewError changes,
21
18
// pkg/go/doc/doc.go should be adjusted since it hardwires
22
19
// this name in a heuristic.
23
20
 
24
 
// NewError converts s to an ErrorString, which satisfies the Error interface.
25
 
func NewError(s string) Error { return ErrorString(s) }
 
21
// // NewError returns a new error with error.String() == s.
 
22
func NewError(s string) Error { return errorString(s) }
26
23
 
27
24
// PathError records an error and the operation and file path that caused it.
28
25
type PathError struct {