Standard library / flag
flag.Parsed()
Reports whether Parse has been called, not whether all inputs were valid. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func Parsed() boolReturn Value
bool
Reports whether Parse has been called, not whether all inputs were valid.
Working Example
Example Snippetgo
package main
import ( "flag" "fmt")
func main() { v := flag.Int("x", 0, "value"); _ = v; flag.Parse(); fmt.Println(flag.Parsed()) }