我需要删除地图中的条目。我尝试使用“删除”命令:
var actionResponseChannels = map[string]chan structs.ActionResponse{}
...
delete(actionResponseChannels, refID)
但我从 go 中得到一个错误:
不能在要删除的参数中使用 actionResponseChannels (type map[string]chan structs.ActionResponse) 作为类型 http.ResponseWriter: map[string]chan structs.ActionResponse 没有实现 http.ResponseWriter (缺少 Header 方法)go 不能使用 refID (type string ) 作为类型 *http.Request 在 deletego 的参数中
在我看来,删除与地图功能无关。
我正在使用 GO 版本 1.13.8 Linux/amd64。
有没有办法处理这个?谢谢。
慕标5832272
相关分类