stylistic changes

This commit is contained in:
Bora M. Alper 2018-12-30 08:25:03 +03:00
parent e01a3bed40
commit 06383d1a2e
No known key found for this signature in database
GPG Key ID: 8F1A9504E1BD114D
5 changed files with 8 additions and 7 deletions

View File

@ -2,8 +2,9 @@ package metadata
import ( import (
"bytes" "bytes"
"github.com/anacrolix/torrent/bencode"
"testing" "testing"
"github.com/anacrolix/torrent/bencode"
) )
var operationsTest_instances = []struct { var operationsTest_instances = []struct {

View File

@ -8,13 +8,15 @@ package mainline
import ( import (
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"github.com/pkg/errors"
"net" "net"
"github.com/pkg/errors"
"regexp"
"github.com/anacrolix/missinggo/iter" "github.com/anacrolix/missinggo/iter"
"github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/bencode"
"github.com/willf/bloom" "github.com/willf/bloom"
"regexp"
) )
type Message struct { type Message struct {

View File

@ -48,7 +48,7 @@ func apiTorrentsHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
if tq.LastID != nil && *tq.LastID < 0 { if tq.LastID == nil {
respondError(w, 400, "lastID has to be greater than or equal to zero") respondError(w, 400, "lastID has to be greater than or equal to zero")
return return
} }

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"fmt"
"testing" "testing"
) )
@ -113,5 +112,4 @@ func TestSchemaRequired(t *testing.T) {
if err == nil { if err == nil {
t.Error("err is nil") t.Error("err is nil")
} }
fmt.Printf(err.Error())
} }

View File

@ -8,4 +8,4 @@ import (
func HexField(key string, val []byte) zapcore.Field { func HexField(key string, val []byte) zapcore.Field {
return zapcore.Field{Key: key, Type: zapcore.StringType, String: hex.EncodeToString(val)} return zapcore.Field{Key: key, Type: zapcore.StringType, String: hex.EncodeToString(val)}
} }