package
0.0.0-20240709090339-eb9e24cd1b44
Repository: https://github.com/mmatczuk/anyflag.git
Documentation: pkg.go.dev
# README
URL
This example shows how anytype
can be used for adding a custom validation to a flag.
- Run
go run . --auth user:pass
, and see it prints:
user:pass
- Run
go run . --auth user:
, and see it prints:
Error: invalid argument "user:" for "--auth" flag: password is required
- Run
go run . --auth :pass
, and see it prints:
Error: invalid argument "user:" for "--auth" flag: password is required