function - golang 调用中的参数太多

标签 function go webrtc collider apprtc

我正在增强这个 Golang 项目:https://github.com/webrtc/apprtc/blob/master/src/collider/collider/collider.go

我向 Run 方法添加了新参数:

// Run starts the collider server and blocks the thread until the program exits.
func (c *Collider) Run(p int, useTls bool, cert string, key string) {
    http.Handle("/ws", websocket.Handler(c.wsHandler))
    http.HandleFunc("/status", c.httpStatusHandler)
    http.HandleFunc("/", c.httpHandler)

    var e error

它是从 main.go 调用的:

https://github.com/webrtc/apprtc/blob/master/src/collider/collidermain/main.go

// run the program
func (p *program) run() {
    configuration := InitConfiguration()

    log.Printf("Running collider: tls = %t, port = %d, room_server=%s", 
                configuration.Tls, configuration.Port, configuration.RoomServer)

    c := collider.NewCollider(configuration.RoomServer)
    c.Run(configuration.Port, configuration.Tls, configuration.Cert, configuration.Key)
}

由于某些原因,我不断收到以下错误:

/usr/local/go/src/collidermain/main.go:84: too many arguments in call to c.Run

我在以下位置交叉检查了 src: /usr/local/go/src/对撞机 /usr/local/go/src/collidermain

一切都很好。不确定为什么会不断发生此错误。

有什么想法吗?

最佳答案

我终于在卸载 go 之前修复了它。

我删除了/usr/local/go 文件夹并重新安装。

注意:/usr/local/go/collider 中的 collider 文件夹之前有我的更改,但 collidermain 仍未与其正确链接。一定是缓存的构建中间体?

关于function - golang 调用中的参数太多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44339166/

相关文章:

javascript - 将文本聊天添加到 webRTC 音频/视频聊天

ios - WebRTC iOS : remote video is not shown in iOS client

jQuery 将字符串作为函数执行

c++对函数执行操作并声明函数

go - 如何确定golang中连接的确切字节长度?

Go - 将 NULL 解析为 time.Time in Struct

javascript - 为什么在将 javascript 函数分配给不同的 var 后不能通过其原始名称访问它?

php - 在PHP中的函数中加载全局变量

goyaml 将字符串转换为 int 常量

javascript - 如何清除关闭的 RTCPeerConnection >> [使用解决方法]