mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os: document that NewFile can return nil
Fixes #20023 Change-Id: I1bec3e69031ffcfd7ad71716be9597ec322528ff Reviewed-on: https://go-review.googlesource.com/41211 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
2d1829b539
commit
9a432552cb
3 changed files with 9 additions and 3 deletions
|
|
@ -59,7 +59,9 @@ func (f *File) Fd() uintptr {
|
|||
return uintptr(f.pfd.Sysfd)
|
||||
}
|
||||
|
||||
// NewFile returns a new File with the given file descriptor and name.
|
||||
// NewFile returns a new File with the given file descriptor and
|
||||
// name. The returned value will be nil if fd is not a valid file
|
||||
// descriptor.
|
||||
func NewFile(fd uintptr, name string) *File {
|
||||
return newFile(fd, name, false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue