mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-23 17:47:29 +00:00
lint: gofumpt files
This commit is contained in:
parent
b81a310eea
commit
d1b90c0139
6 changed files with 9 additions and 8 deletions
|
@ -5,7 +5,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestClientID(t *testing.T) {
|
func TestClientID(t *testing.T) {
|
||||||
var clientTable = []struct{ peerID, clientID string }{
|
clientTable := []struct{ peerID, clientID string }{
|
||||||
{"-AZ3034-6wfG2wk6wWLc", "AZ3034"},
|
{"-AZ3034-6wfG2wk6wWLc", "AZ3034"},
|
||||||
{"-AZ3042-6ozMq5q6Q3NX", "AZ3042"},
|
{"-AZ3042-6ozMq5q6Q3NX", "AZ3042"},
|
||||||
{"-BS5820-oy4La2MWGEFj", "BS5820"},
|
{"-BS5820-oy4La2MWGEFj", "BS5820"},
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNew(t *testing.T) {
|
func TestNew(t *testing.T) {
|
||||||
var table = []struct {
|
table := []struct {
|
||||||
data string
|
data string
|
||||||
expected Event
|
expected Event
|
||||||
expectedErr error
|
expectedErr error
|
||||||
|
|
|
@ -90,7 +90,7 @@ func marshal(w io.Writer, data interface{}) (err error) {
|
||||||
err = marshalList(w, v)
|
err = marshalList(w, v)
|
||||||
|
|
||||||
case []Dict:
|
case []Dict:
|
||||||
var interfaceSlice = make([]interface{}, len(v))
|
interfaceSlice := make([]interface{}, len(v))
|
||||||
for i, d := range v {
|
for i, d := range v {
|
||||||
interfaceSlice[i] = d
|
interfaceSlice[i] = d
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWriteError(t *testing.T) {
|
func TestWriteError(t *testing.T) {
|
||||||
var table = []struct {
|
table := []struct {
|
||||||
reason, expected string
|
reason, expected string
|
||||||
}{
|
}{
|
||||||
{"hello world", "d14:failure reason11:hello worlde"},
|
{"hello world", "d14:failure reason11:hello worlde"},
|
||||||
|
@ -29,7 +29,7 @@ func TestWriteError(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWriteStatus(t *testing.T) {
|
func TestWriteStatus(t *testing.T) {
|
||||||
var table = []struct {
|
table := []struct {
|
||||||
reason, expected string
|
reason, expected string
|
||||||
}{
|
}{
|
||||||
{"something is missing", "d14:failure reason20:something is missinge"},
|
{"something is missing", "d14:failure reason20:something is missinge"},
|
||||||
|
|
|
@ -23,7 +23,8 @@ func createNew() s.PeerStore {
|
||||||
RedisBroker: redisURL,
|
RedisBroker: redisURL,
|
||||||
RedisReadTimeout: 10 * time.Second,
|
RedisReadTimeout: 10 * time.Second,
|
||||||
RedisWriteTimeout: 10 * time.Second,
|
RedisWriteTimeout: 10 * time.Second,
|
||||||
RedisConnectTimeout: 10 * time.Second})
|
RedisConnectTimeout: 10 * time.Second,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ func (rc *redisConnector) NewPool() *redis.Pool {
|
||||||
|
|
||||||
// Open a new Redis connection
|
// Open a new Redis connection
|
||||||
func (rc *redisConnector) open() (redis.Conn, error) {
|
func (rc *redisConnector) open() (redis.Conn, error) {
|
||||||
var opts = []redis.DialOption{
|
opts := []redis.DialOption{
|
||||||
redis.DialDatabase(rc.URL.DB),
|
redis.DialDatabase(rc.URL.DB),
|
||||||
redis.DialReadTimeout(rc.ReadTimeout),
|
redis.DialReadTimeout(rc.ReadTimeout),
|
||||||
redis.DialWriteTimeout(rc.WriteTimeout),
|
redis.DialWriteTimeout(rc.WriteTimeout),
|
||||||
|
@ -119,7 +119,7 @@ func parseRedisURL(target string) (*redisURL, error) {
|
||||||
return nil, errors.New("no redis scheme found")
|
return nil, errors.New("no redis scheme found")
|
||||||
}
|
}
|
||||||
|
|
||||||
db := 0 //default redis db
|
db := 0 // default redis db
|
||||||
parts := strings.Split(u.Path, "/")
|
parts := strings.Split(u.Path, "/")
|
||||||
if len(parts) != 1 {
|
if len(parts) != 1 {
|
||||||
db, err = strconv.Atoi(parts[1])
|
db, err = strconv.Atoi(parts[1])
|
||||||
|
|
Loading…
Add table
Reference in a new issue