Skip to content

Instantly share code, notes, and snippets.

@tebeka
Created March 10, 2022 10:17
Show Gist options
  • Save tebeka/00c3b9ca3a039a0ae0f4758605f8df13 to your computer and use it in GitHub Desktop.
Save tebeka/00c3b9ca3a039a0ae0f4758605f8df13 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