I\'m using docopt to parse command-line arguments. This works, and it results in a map, such as
map[:www.google.de :80 --help:false --ver
You need to add type assertion .(string)
. It is necessary because the map is of type map[string]interface{}
:
host := arguments[""].(string) + ":" + arguments[""].(string)
Latest version of Docopt returns Opts object that has methods for conversion:
host, err := arguments.String("")
port, err := arguments.String("")
host_port := host + ":" + port