我正在增强这个 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/collider /usr/local/go/src/collidermain
一切都很好。不知道为什么这个错误不断发生。
有什么想法吗?