Remove useless variable from cockroach store (#1400)
This commit is contained in:
parent
914340585c
commit
eb4d2ae6aa
2
go.mod
2
go.mod
@ -35,7 +35,7 @@ require (
|
||||
github.com/imdario/mergo v0.3.8
|
||||
github.com/jonboulle/clockwork v0.1.0 // indirect
|
||||
github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1
|
||||
github.com/json-iterator/go v1.1.9
|
||||
github.com/json-iterator/go v1.1.9 // indirect
|
||||
github.com/kr/pretty v0.1.0
|
||||
github.com/leodido/go-urn v1.2.0 // indirect
|
||||
github.com/lib/pq v1.3.0
|
||||
|
@ -296,9 +296,8 @@ func (s *sqlStore) initDB() error {
|
||||
}
|
||||
|
||||
func (s *sqlStore) configure() error {
|
||||
nodes := s.options.Nodes
|
||||
if len(nodes) == 0 {
|
||||
nodes = []string{"localhost:26257"}
|
||||
if len(s.options.Nodes) == 0 {
|
||||
s.options.Nodes = []string{"localhost:26257"}
|
||||
}
|
||||
|
||||
namespace := s.options.Namespace
|
||||
@ -318,7 +317,7 @@ func (s *sqlStore) configure() error {
|
||||
}
|
||||
namespace = reg.ReplaceAllString(namespace, "_")
|
||||
|
||||
source := nodes[0]
|
||||
source := s.options.Nodes[0]
|
||||
// check if it is a standard connection string eg: host=%s port=%d user=%s password=%s dbname=%s sslmode=disable
|
||||
// if err is nil which means it would be a URL like postgre://xxxx?yy=zz
|
||||
_, err = url.Parse(source)
|
||||
|
Loading…
Reference in New Issue
Block a user