Standard library / io/fs
fs.ModeCharDevice
FileMode flag representing character device when ModeDevice is also set. 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 ModeCharDevice FileMode = 2097152Working Example
Example Snippetgo
package main
import ( "fmt" "io/fs")
func main() { m := fs.ModeCharDevice | 0644; fmt.Println(m&fs.ModeCharDevice != 0) }