gpt4 book ai didi

function - golang 调用中的参数太多

转载 作者:IT王子 更新时间:2023-10-29 02:11:49 27 4
gpt4 key购买 nike

我正在增强这个 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com