Updated golandci-lint to 1.21.0

Signed-off-by: Michał Matczuk <michal@scylladb.com>
This commit is contained in:
Michał Matczuk
2019-11-08 00:03:26 +01:00
committed by Michal Matczuk
parent 3e60935d2a
commit 1668ca5832
8 changed files with 36 additions and 31 deletions

View File

@@ -7,7 +7,6 @@ package gocqlxtest
import (
"flag"
"fmt"
"log"
"strings"
"sync"
"testing"
@@ -24,16 +23,8 @@ var (
flagRetry = flag.Int("retries", 5, "number of times to retry queries")
flagCompressTest = flag.String("compressor", "", "compressor to use")
flagTimeout = flag.Duration("gocql.timeout", 5*time.Second, "sets the connection `timeout` for all operations")
clusterHosts []string
)
func init() {
flag.Parse()
clusterHosts = strings.Split(*flagCluster, ",")
log.SetFlags(log.Lshortfile | log.LstdFlags)
}
var initOnce sync.Once
// CreateSession creates a new gocql session from flags.
@@ -43,6 +34,11 @@ func CreateSession(tb testing.TB) *gocql.Session {
}
func createCluster() *gocql.ClusterConfig {
if !flag.Parsed() {
flag.Parse()
}
clusterHosts := strings.Split(*flagCluster, ",")
cluster := gocql.NewCluster(clusterHosts...)
cluster.ProtoVersion = *flagProto
cluster.CQLVersion = *flagCQL