Problem
parseHostMappings produces precise diagnostics:
value %q has no separator, =
value %q has no src port %q
value %q has invalid src port %q
value %q has invalid dst port %q
mustParseHostMappings throws all of them away and prints the raw slice instead.
Reproduction
$ http-assert --maphost 'garbage' --assert-ok http://127.0.0.1:8791/ok
Error: Invalid value for --maphost flag: [garbage]
[exit=71]
Expected something like:
Error: Invalid value for --maphost flag: value "garbage" has no separator, =
Affected code
main.go — mustParseHostMappings (the err return is ignored)
Suggested fix
Include err in the die format string. One-line change, free UX win.
Problem
parseHostMappingsproduces precise diagnostics:value %q has no separator, =value %q has no src port %qvalue %q has invalid src port %qvalue %q has invalid dst port %qmustParseHostMappingsthrows all of them away and prints the raw slice instead.Reproduction
Expected something like:
Affected code
main.go—mustParseHostMappings(theerrreturn is ignored)Suggested fix
Include
errin thedieformat string. One-line change, free UX win.