-
Notifications
You must be signed in to change notification settings - Fork 0
/
returncodes.go
46 lines (43 loc) · 934 Bytes
/
returncodes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package returncodes
// Code is the basic type for all returncodes
type Code int
//Current pfsm supported return codes
const (
OK Code = iota
ENOENT //No such file or directory.
EACCES //Can not access file
EEXIST //File already exists
ENOTEMPTY //Directory not empty
EISDIR //Is Directory
EIO //Input/Output error
ENOTDIR //Isn't Directory
EBUSY //System is busy
EUNEXPECTED //Unforseen error
)
// String returns the code as a string
func (c Code) String() string {
switch c {
case OK:
return "OK"
case ENOENT:
return "ENOENT"
case EACCES:
return "EACCES"
case EEXIST:
return "EEXIST"
case ENOTEMPTY:
return "ENOTEMPTY"
case EISDIR:
return "EISDIR"
case EIO:
return "EIO"
case ENOTDIR:
return "ENOTDIR"
case EBUSY:
return "EBUSY"
case EUNEXPECTED:
return "EUNEXPECTED"
default:
return ""
}
}