Skip to content

Instantly share code, notes, and snippets.

@tebeka
Created March 9, 2022 08:12
Show Gist options
  • Select an option

  • Save tebeka/5b9b2dd236b1e8cbde5ea33aaa4d81c8 to your computer and use it in GitHub Desktop.

Select an option

Save tebeka/5b9b2dd236b1e8cbde5ea33aaa4d81c8 to your computer and use it in GitHub Desktop.
filePerm := Read | Write // set permission (| is bitwise OR)
if filePerm&Write != 0 { // check permission (& is bitwise AND)
fmt.Println("can write")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment