golang 获取get参数
keys, ok := r.URL.Query()["key"] if !ok || len(keys) < 1 {log.Println("Url Param 'key' is missing")
return
}
// Query()["key"] will return an array of items,
// we only want the single item.
key := keys
log.Println("Url Param 'key' is: " + string(key))
页:
[1]