]> Cypherpunks repositories - gostls13.git/commitdiff
os: homogenize error checks on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Tue, 23 Jan 2018 20:58:33 +0000 (21:58 +0100)
committerDavid du Colombier <0intro@gmail.com>
Wed, 24 Jan 2018 07:18:36 +0000 (07:18 +0000)
Remove leading space at the beginning of error strings,
so the strings are consistent between isExist, isNotExist
and isPermission functions.

Here is a list of error strings returned on the most common
file servers on Plan 9:

     match                     cwfs                      fossil                   ramfs

"exists"            "create/wstat -- file exists"  "file already exists"    "file exists"
"is a directory"                                   "is a directory"         "file is a directory"

"does not exist"                                   "file does not exist"    "file does not exist"
"not found"         "directory entry not found"
"has been removed"                                 "file has been removed"

"permission denied" "access permission denied"     "permission denied"      "permission denied"

"no parent" is an error returned by lib9p when removing a file without parent.

Change-Id: I2362ed4b6730b8bec7a707a1052bd1ad8921cd97
Reviewed-on: https://go-review.googlesource.com/89315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/os/error_plan9.go

index 0d76a66e45353b934ea2417233d4ac00f1f27dc6..b82bf0dea37c668772c5b793e5d26ac9a8871ac0 100644 (file)
@@ -5,7 +5,7 @@
 package os
 
 func isExist(err error) bool {
-       return checkErrMessageContent(err, " exists", " is a directory")
+       return checkErrMessageContent(err, "exists", "is a directory")
 }
 
 func isNotExist(err error) bool {