Standard library / io/fs

fs.ModeSetuid

FileMode flag representing set-user-ID. Test with a bitwise AND; setting a bit in a Go value does not change actual filesystem metadata. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const ModeSetuid FileMode = 8388608

Working Example

Example Snippetgo
package main
import (  "fmt"  "io/fs")
func main() { m := fs.ModeSetuid | 0644; fmt.Println(m&fs.ModeSetuid != 0) }
Go Reference