Standard library / net

net.Flags

Bitmask of network interface characteristics. Use bitwise tests rather than equality to check individual capabilities. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type Flags uint

Working Example

Example Snippetgo
package main
import (  "fmt"  "net")
func main() { fmt.Println((net.FlagUp|net.FlagLoopback)&net.FlagLoopback != 0) }
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference