mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Bring code into line with Golangci-lint linters
- Error strings are no longer capitalized nor end with punctuation - Alias import - Remove extraneous initilisation code (No need to provide zero value for variables, because the compiler does that anyway)
This commit is contained in:
parent
b26c7a7a73
commit
8bbdb3b51a
6 changed files with 11 additions and 11 deletions
|
@ -44,13 +44,13 @@ func (p *Peers) Collect() (Snowflake, error) {
|
|||
cnt := p.Count()
|
||||
s := fmt.Sprintf("Currently at [%d/%d]", cnt, p.capacity)
|
||||
if cnt >= p.capacity {
|
||||
s := fmt.Sprintf("At capacity [%d/%d]", cnt, p.capacity)
|
||||
s = fmt.Sprintf("At capacity [%d/%d]", cnt, p.capacity)
|
||||
return nil, errors.New(s)
|
||||
}
|
||||
log.Println("WebRTC: Collecting a new Snowflake.", s)
|
||||
// Engage the Snowflake Catching interface, which must be available.
|
||||
if nil == p.Tongue {
|
||||
return nil, errors.New("Missing Tongue to catch Snowflakes with.")
|
||||
return nil, errors.New("missing Tongue to catch Snowflakes with")
|
||||
}
|
||||
// BUG: some broker conflict here.
|
||||
connection, err := p.Tongue.Catch()
|
||||
|
|
|
@ -144,7 +144,7 @@ func NewWebRTCDialer(
|
|||
// Initialize a WebRTC Connection by signaling through the broker.
|
||||
func (w WebRTCDialer) Catch() (Snowflake, error) {
|
||||
if nil == w.BrokerChannel {
|
||||
return nil, errors.New("Cannot Dial WebRTC without a BrokerChannel.")
|
||||
return nil, errors.New("cannot Dial WebRTC without a BrokerChannel")
|
||||
}
|
||||
// TODO: [#3] Fetch ICE server information from Broker.
|
||||
// TODO: [#18] Consider TURN servers here too.
|
||||
|
|
|
@ -309,7 +309,7 @@ func (c *WebRTCPeer) exchangeSDP() error {
|
|||
}
|
||||
// Keep trying the same offer until a valid answer arrives.
|
||||
var ok bool
|
||||
var answer *webrtc.SessionDescription = nil
|
||||
var answer *webrtc.SessionDescription
|
||||
for nil == answer {
|
||||
go c.sendOfferToBroker()
|
||||
answer, ok = <-c.answerChannel // Blocks...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue