File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 name : run go tests
1616 command : |
1717 set -e
18- go get -v .
19- go get golang.org/x/lint/golint
18+ go get -u github.com/mitchellh/colorstring
19+ go get -u github.com/pions/webrtc
20+ go get -u github.com/kr/pty
21+ go get -u golang.org/x/crypto/ssh/terminal
22+ go get -u github.com/btcsuite/btcutil/base58
23+ go get -u golang.org/x/lint/golint
2024 golint
2125 go test
2226 go test ./pkg/sd
Original file line number Diff line number Diff line change @@ -110,10 +110,8 @@ func (cs *clientSession) run() (err error) {
110110 return
111111 }
112112
113- cs .dc .Lock ()
114- cs .dc .OnOpen = cs .dataChannelOnOpen ()
115- cs .dc .Onmessage = cs .dataChannelOnMessage ()
116- cs .dc .Unlock ()
113+ cs .dc .OnOpen (cs .dataChannelOnOpen ())
114+ cs .dc .OnMessage (cs .dataChannelOnMessage ())
117115
118116 if cs .offer , err = sd .Decode (cs .offerString ); err != nil {
119117 log .Println (err )
Original file line number Diff line number Diff line change @@ -171,10 +171,8 @@ func (hs *hostSession) dataChannelOnMessage() func(payload datachannel.Payload)
171171func (hs * hostSession ) onDataChannel () func (dc * webrtc.RTCDataChannel ) {
172172 return func (dc * webrtc.RTCDataChannel ) {
173173 hs .dc = dc
174- dc .Lock ()
175- defer dc .Unlock ()
176- dc .OnOpen = hs .dataChannelOnOpen ()
177- dc .Onmessage = hs .dataChannelOnMessage ()
174+ dc .OnOpen (hs .dataChannelOnOpen ())
175+ dc .OnMessage (hs .dataChannelOnMessage ())
178176 }
179177}
180178
@@ -186,7 +184,7 @@ func (hs *hostSession) mustReadStdin() (string, error) {
186184}
187185
188186func (hs * hostSession ) createOffer () (err error ) {
189- hs .pc .OnDataChannel = hs .onDataChannel ()
187+ hs .pc .OnDataChannel ( hs .onDataChannel () )
190188
191189 // Create an offer to send to the browser
192190 offer , err := hs .pc .CreateOffer (nil )
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ func (s *session) createPeerConnection() (err error) {
8080 // if s.pc.OnDataChannel == nil {
8181 // return errors.New("Couldn't create a peerConnection")
8282 // }
83- s .pc .OnICEConnectionStateChange = func (connectionState ice.ConnectionState ) {
83+ s .pc .OnICEConnectionStateChange ( func (connectionState ice.ConnectionState ) {
8484 log .Printf ("ICE Connection State has changed: %s\n " , connectionState .String ())
85- }
85+ })
8686 return
8787}
You can’t perform that action at this time.
0 commit comments