Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ff
✓ github.com/peterbourgon/ff
Parse flags with environment variable support
package main
import (
"flag"
"github.com/peterbourgon/ff"
)
func main() {
fs := flag.NewFlagSet("example", flag.ExitOnError)
var name string
fs.StringVar(&name, "name", "world", "a name to greet")
ff.Parse(fs, os.Args[1:], ff.WithEnvVarPrefix("MYAPP"))
fmt.Printf("Hello, %s!\n", name)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.7.1latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.