Registry / config / octago-sflags

octago-sflags

JSON →
library0.4.1gogounverified

Package sflags helps to generate flags by parsing structure.

go get github.com/octago/sflags
INSTALL
IMPORT
SIG · OCTAGO-SFLAGS
O
octago-sflags
configgov0.4.1
harness data pending
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.

sflags
github.com/octago/sflags

Parses command-line flags from a struct definition.

package main import ( "flag" "fmt" "github.com/octago/sflags" ) type Config struct { Name string `flag:"name" default:"world"` } func main() { cfg := &Config{} fs := flag.NewFlagSet("example", flag.ExitOnError) sflags.ParseStruct(fs, cfg) fs.Parse([]string{"-name", "Go"}) fmt.Println("Hello", cfg.Name) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.4.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
36
Amazon
1
Resources
octago-sflags — go get octago-sflags · libregistry