os: talk about errors and PathError in the package documentation
Fixes #2383.
R=golang-dev, bradfitz, adg, rsc
CC=golang-dev
https://golang.org/cl/5641061
diff --git a/src/pkg/os/file_windows.go b/src/pkg/os/file_windows.go
index b84f210..0b721c6 100644
--- a/src/pkg/os/file_windows.go
+++ b/src/pkg/os/file_windows.go
@@ -87,7 +87,7 @@
// or Create instead. It opens the named file with specified flag
// (O_RDONLY etc.) and perm, (0666 etc.) if applicable. If successful,
// methods on the returned File can be used for I/O.
-// It returns the File and an error, if any.
+// If there is an error, it will be of type *PathError.
func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
if name == "" {
return nil, &PathError{"open", name, syscall.ENOENT}
@@ -267,6 +267,7 @@
}
// Remove removes the named file or directory.
+// If there is an error, it will be of type *PathError.
func Remove(name string) error {
p := &syscall.StringToUTF16(name)[0]