Skip to content

Instantly share code, notes, and snippets.

@tebeka
Created March 9, 2022 08:12
Show Gist options
  • Save tebeka/36d5ce690c6ad35bfc66cba6b5a116f7 to your computer and use it in GitHub Desktop.
Save tebeka/36d5ce690c6ad35bfc66cba6b5a116f7 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