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) {
|
||||
var clientTable = []struct{ peerID, clientID string }{
|
||||
clientTable := []struct{ peerID, clientID string }{
|
||||
{"-AZ3034-6wfG2wk6wWLc", "AZ3034"},
|
||||
{"-AZ3042-6ozMq5q6Q3NX", "AZ3042"},
|
||||
{"-BS5820-oy4La2MWGEFj", "BS5820"},
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
var table = []struct {
|
||||
table := []struct {
|
||||
data string
|
||||
expected Event
|
||||
expectedErr error
|
||||
|
|
|
@ -90,7 +90,7 @@ func marshal(w io.Writer, data interface{}) (err error) {
|
|||
err = marshalList(w, v)
|
||||
|
||||
case []Dict:
|
||||
var interfaceSlice = make([]interface{}, len(v))
|
||||
interfaceSlice := make([]interface{}, len(v))
|
||||
for i, d := range v {
|
||||
interfaceSlice[i] = d
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
)
|
||||
|
||||
func TestWriteError(t *testing.T) {
|
||||
var table = []struct {
|
||||
table := []struct {
|
||||
reason, expected string
|
||||
}{
|
||||
{"hello world", "d14:failure reason11:hello worlde"},
|
||||
|
@ -29,7 +29,7 @@ func TestWriteError(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestWriteStatus(t *testing.T) {
|
||||
var table = []struct {
|
||||
table := []struct {
|
||||
reason, expected string
|
||||
}{
|
||||
{"something is missing", "d14:failure reason20:something is missinge"},
|
||||
|
|
|
@ -23,7 +23,8 @@ func createNew() s.PeerStore {
|
|||
RedisBroker: redisURL,
|
||||
RedisReadTimeout: 10 * time.Second,
|
||||
RedisWriteTimeout: 10 * time.Second,
|
||||
RedisConnectTimeout: 10 * time.Second})
|
||||
RedisConnectTimeout: 10 * time.Second,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ func (rc *redisConnector) NewPool() *redis.Pool {
|
|||
|
||||
// Open a new Redis connection
|
||||
func (rc *redisConnector) open() (redis.Conn, error) {
|
||||
var opts = []redis.DialOption{
|
||||
opts := []redis.DialOption{
|
||||
redis.DialDatabase(rc.URL.DB),
|
||||
redis.DialReadTimeout(rc.ReadTimeout),
|
||||
redis.DialWriteTimeout(rc.WriteTimeout),
|
||||
|
@ -119,7 +119,7 @@ func parseRedisURL(target string) (*redisURL, error) {
|
|||
return nil, errors.New("no redis scheme found")
|
||||
}
|
||||
|
||||
db := 0 //default redis db
|
||||
db := 0 // default redis db
|
||||
parts := strings.Split(u.Path, "/")
|
||||
if len(parts) != 1 {
|
||||
db, err = strconv.Atoi(parts[1])
|
||||
|
|
Loading…
Reference in a new issue