使用http时使用delete函数删除地图条目
我需要删除地图中的一个条目。 我尝试使用delete命令:使用http时使用delete函数删除地图条目,http,dictionary,go,Http,Dictionary,Go,我需要删除地图中的一个条目。 我尝试使用delete命令: var actionResponseChannels = map[string]chan structs.ActionResponse{} ... delete(actionResponseChannels, refID) 但我从go得到一个错误: 无法使用actionResponseChannels类型映射[string]chan structs.ActionResponse作为参数中的http.ResponseWriter类型 删
var actionResponseChannels = map[string]chan structs.ActionResponse{}
...
delete(actionResponseChannels, refID)
但我从go得到一个错误:
无法使用actionResponseChannels类型映射[string]chan
structs.ActionResponse作为参数中的http.ResponseWriter类型
删除:映射[string]chan structs.ActionResponse未实现
http.ResponseWriter缺少标头methodgo无法使用refID类型
deletego参数中的字符串类型为*http.Request
在我看来,delete与map函数无关
我使用的是GO版本1.13.8Linux/amd64
有办法解决这个问题吗?
谢谢。您的包中有一些名为delete的HTTP处理程序函数,它隐藏了内置函数。重命名HTTP处理程序函数。您的包中可能有一个删除函数。叫点别的吧。