Skip to content

Instantly share code, notes, and snippets.

@tebeka
Created March 9, 2022 08:14
Show Gist options
  • Save tebeka/8ae49733c68b61d799631911310bb101 to your computer and use it in GitHub Desktop.
Save tebeka/8ae49733c68b61d799631911310bb101 to your computer and use it in GitHub Desktop.
func (p FilePerm) String() string {
switch p {
case Read:
return "read"
case Write:
return "write"
case Execute:
return "execute"
}
return fmt.Sprintf("<FilePerm: %d>", p) // don't use %s or %v here :)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment