Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用http时使用delete函数删除地图条目_Http_Dictionary_Go - Fatal编程技术网

使用http时使用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类型 删

我需要删除地图中的一个条目。 我尝试使用delete命令:

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处理程序函数。

您的包中可能有一个删除函数。叫点别的吧。