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

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

Issue 5783092: code review 5783092: os: remove document duplication in error predicate functions (Closed)
Left Patch Set: Created 13 years ago
Right Patch Set: diff -r 162b42fd9e57 https://code.google.com/p/go/ Created 13 years 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:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/os/error_plan9.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
(no file at all)
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 import ( 7 import (
8 "errors" 8 "errors"
9 ) 9 )
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 // NewSyscallError returns, as an error, a new SyscallError 36 // NewSyscallError returns, as an error, a new SyscallError
37 // with the given system call name and error details. 37 // with the given system call name and error details.
38 // As a convenience, if err is nil, NewSyscallError returns nil. 38 // As a convenience, if err is nil, NewSyscallError returns nil.
39 func NewSyscallError(syscall string, err error) error { 39 func NewSyscallError(syscall string, err error) error {
40 if err == nil { 40 if err == nil {
41 return nil 41 return nil
42 } 42 }
43 return &SyscallError{syscall, err} 43 return &SyscallError{syscall, err}
44 } 44 }
45
46 // IsExist returns whether the error is known to report that a file already exis ts.
47 // It is satisfied by ErrExist as well as some syscall errors.
48 func IsExist(err error) bool {
49 return isExist(err)
50 }
51
52 // IsNotExist returns whether the error is known to report that a file does not exist.
53 // It is satisfied by ErrNotExist as well as some syscall errors.
54 func IsNotExist(err error) bool {
55 return isNotExist(err)
56 }
57
58 // IsPermission returns whether the error is known to report that permission is denied.
59 // It is satisfied by ErrPermission as well as some syscall errors.
60 func IsPermission(err error) bool {
61 return isPermission(err)
62 }
LEFTRIGHT

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