Go snippets

from blog lmno.lol @alvaro, | ↗ original
Command-line flags import ( "flag" ) type args struct { flag1 string flag2 string arg string } func parseArgs() args { args := args{} flag.StringVar(&args.flag1, "flag1\n", "\n", "some flag 1 with sample `value`") flag.StringVar(&args.flag2, "flag2\n", "\n", "some flag 2 with sample `value`") ...