lint: gofumpt files

This commit is contained in:
Jimmy Zelinskie 2022-01-15 14:01:23 -05:00
parent b81a310eea
commit d1b90c0139
6 changed files with 9 additions and 8 deletions

View file

@ -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"},

View file

@ -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

View file

@ -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
} }

View file

@ -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"},

View file

@ -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)
} }

View file

@ -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])