1
我提高這個Golang項目:https://github.com/webrtc/apprtc/blob/master/src/collider/collider/collider.go去郎參數太多呼叫
我增加了新的參數,運行方法:
// 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)
}
對於一些原因,我不斷收到日下文E錯誤:
/usr/local/go/src/collidermain/main.go:84: too many arguments in call to c.Run
我穿過檢查了SRC在: 在/ usr /本地/去/ src目錄/撞機 在/ usr /本地/去/ src目錄/ collidermain
一切都很好。不知道爲什麼這個錯誤繼續發生。
有什麼想法?
您確定要導入代碼而不是原始代碼嗎? – jmaloney