2017-06-03 120 views
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

一切都很好。不知道爲什麼這個錯誤繼續發生。

有什麼想法?

+1

您確定要導入代碼而不是原始代碼嗎? – jmaloney

回答

1

我終於解決它之前卸載去。

我刪除了/ usr/local/go文件夾並重新安裝。

注意:在/ usr/local/go/collider中的collider文件夾之前有過我的更改,但仍然沒有正確鏈接collidermain。一定是緩存的構建中間體?