Remove useless variable from cockroach store (#1400)

This commit is contained in:
Jake Sanders 2020-03-24 15:37:30 +00:00 committed by GitHub
parent 914340585c
commit eb4d2ae6aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

2
go.mod
View File

@ -35,7 +35,7 @@ require (
github.com/imdario/mergo v0.3.8 github.com/imdario/mergo v0.3.8
github.com/jonboulle/clockwork v0.1.0 // indirect github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1 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/kr/pretty v0.1.0
github.com/leodido/go-urn v1.2.0 // indirect github.com/leodido/go-urn v1.2.0 // indirect
github.com/lib/pq v1.3.0 github.com/lib/pq v1.3.0

View File

@ -296,9 +296,8 @@ func (s *sqlStore) initDB() error {
} }
func (s *sqlStore) configure() error { func (s *sqlStore) configure() error {
nodes := s.options.Nodes if len(s.options.Nodes) == 0 {
if len(nodes) == 0 { s.options.Nodes = []string{"localhost:26257"}
nodes = []string{"localhost:26257"}
} }
namespace := s.options.Namespace namespace := s.options.Namespace
@ -318,7 +317,7 @@ func (s *sqlStore) configure() error {
} }
namespace = reg.ReplaceAllString(namespace, "_") 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 // 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 // if err is nil which means it would be a URL like postgre://xxxx?yy=zz
_, err = url.Parse(source) _, err = url.Parse(source)