Skip to content

Commit

Permalink
fix various linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Oct 3, 2019
1 parent c2cea30 commit e93e245
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion internal/btconn/accept.go
Expand Up @@ -20,7 +20,6 @@ func Accept(
hasInfoHash func([20]byte) bool,
ourExtensions [8]byte, ourID [20]byte) (
encConn net.Conn, cipher mse.CryptoMethod, peerExtensions [8]byte, peerID [20]byte, infoHash [20]byte, err error) {

log := logger.New("conn <- " + conn.RemoteAddr().String())

if forceEncryption && getSKey == nil {
Expand Down
1 change: 0 additions & 1 deletion internal/btconn/dial.go
Expand Up @@ -23,7 +23,6 @@ func Dial(
ourID [20]byte,
stopC chan struct{}) (
conn net.Conn, cipher mse.CryptoMethod, peerExtensions [8]byte, peerID [20]byte, err error) {

log := logger.New("conn -> " + addr.String())
done := make(chan struct{})
defer close(done)
Expand Down
2 changes: 0 additions & 2 deletions internal/console/console.go
Expand Up @@ -492,7 +492,6 @@ func (c *Console) updateTorrentsAndDetailsLoop(g *gocui.Gui, stop chan struct{})

c.triggerUpdateTorrents()
for {

select {
case <-ticker.C:
c.triggerUpdateTorrents()
Expand All @@ -513,7 +512,6 @@ func (c *Console) updateSessionStatsLoop(g *gocui.Gui, stop chan struct{}) {

c.updateSessionStats(g)
for {

select {
case <-ticker.C:
c.updateSessionStats(g)
Expand Down
2 changes: 1 addition & 1 deletion internal/magnet/magnet_test.go
Expand Up @@ -25,7 +25,7 @@ func TestParse(t *testing.T) {
t.Fatal("invalid tracker")
}
s := m.String()
if strings.ToLower(u) != strings.ToLower(s) {
if !strings.EqualFold(u, s) {
t.Log(u)
t.Log(s)
t.FailNow()
Expand Down
1 change: 0 additions & 1 deletion internal/mse/mse.go
Expand Up @@ -236,7 +236,6 @@ func (s *Stream) HandshakeOutgoing(sKey []byte, cryptoProvide CryptoMethod, init
func (s *Stream) HandshakeIncoming(
getSKey func(sKeyHash [20]byte) (sKey []byte),
cryptoSelect func(provided CryptoMethod) (selected CryptoMethod)) (err error) {

writeBuf := bytes.NewBuffer(make([]byte, 0, 96+512))

Xb, Yb, err := keyPair()
Expand Down
1 change: 0 additions & 1 deletion internal/peerconn/peerconn.go
Expand Up @@ -125,5 +125,4 @@ func (p *Conn) Run() {
return
}
}

}
1 change: 0 additions & 1 deletion torrent/torrent_test.go
Expand Up @@ -137,7 +137,6 @@ func webseed(t *testing.T) (port int, c func()) {
l.Close()
<-servingDone
}

}

func TestDownloadWebseed(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion torrent/torrent_write.go
Expand Up @@ -48,7 +48,6 @@ func (t *torrent) handlePieceWriteDone(pw *piecewriter.PieceWriter) {
t.mBitfield.Unlock()

if t.piecePicker != nil {

_, ok := pw.Source.(*urldownloader.URLDownloader)
src := t.piecePicker.RequestedWebseedSource(pw.Piece.Index)
if !ok && src != nil {
Expand Down

0 comments on commit e93e245

Please sign in to comment.