func test(args ...string) {
var msg map[string] interface{}
i := 0
msg[\"product\"] = args[i++]
msg[\"key\"] = args[i++]
msg[\"signature\"] = args
As other people have said i++
is a statement in go, not an expression as it is in C. Go has a different way of expressing the same intent using multiple assignment:
func test(args ...string) {
msg := make(map[string]string)
i := 0
msg["product"], i = args[i], i+1
msg["key"], i = args[i], i+1
msg["signature"], i = args[i], i+1
msg["string_to_sign"], i = args[i], i+1
fmt.Printf("%v\n", msg)
}
Your definition of map
would have failed at runtime too.