Standard library / log

log.Flags()

Read the active formatting bitmask. Expected stdout: '1\n'.

Formal Syntax & Structure

go syntaxgo
func Flags() int

Return Value

int

Read the active formatting bitmask.

Working Example

Example Snippetgo
package main
import (  "bytes"  "fmt"  "log")
func main() {  var b bytes.Buffer  log.SetOutput(&b)  log.SetFlags(0)  log.SetPrefix("")  log.SetFlags(log.Ldate)  fmt.Println(log.Flags())}
Go Reference