diff --git a/go.mod b/go.mod index 0dd4fc51..e862c8bb 100644 --- a/go.mod +++ b/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 diff --git a/store/cockroach/cockroach.go b/store/cockroach/cockroach.go index d70b0c1c..74bca2a5 100644 --- a/store/cockroach/cockroach.go +++ b/store/cockroach/cockroach.go @@ -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)