package pflag// -- func Valuetype boolfuncValue func(string) errorfunc ( boolfuncValue) ( string) error { return () }func ( boolfuncValue) () string { return"boolfunc" }func ( boolfuncValue) () string { return"" } // same behavior as stdlib 'flag' packagefunc ( boolfuncValue) () bool { returntrue }// BoolFunc defines a func flag with specified name, callback function and usage string.//// The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed// on the command line.func ( *FlagSet) ( string, string, func(string) error) { .BoolFuncP(, "", , )}// BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash.func ( *FlagSet) (, string, string, func(string) error) {varValue = boolfuncValue() := .VarPF(, , , ) .NoOptDefVal = "true"}// BoolFunc defines a func flag with specified name, callback function and usage string.//// The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed// on the command line.func ( string, string, func(string) error) {CommandLine.BoolFuncP(, "", , )}// BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash.func (, string, string, func(string) error) {CommandLine.BoolFuncP(, , , )}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.