mirror of https://github.com/status-im/consul.git
Be more Go idiomatic w/ variable names: s/valid/ok/g
Cargo culting is bad, m'kay? Pointy Hat: sean-
This commit is contained in:
parent
9daccb8b41
commit
7a2d30d1cf
|
@ -19,9 +19,9 @@ func TestIsConsulServer(t *testing.T) {
|
||||||
"vsn": "1",
|
"vsn": "1",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
valid, parts := server_details.IsConsulServer(m)
|
ok, parts := server_details.IsConsulServer(m)
|
||||||
if !valid || parts.Datacenter != "east-aws" || parts.Port != 10000 {
|
if !ok || parts.Datacenter != "east-aws" || parts.Port != 10000 {
|
||||||
t.Fatalf("bad: %v %v", valid, parts)
|
t.Fatalf("bad: %v %v", ok, parts)
|
||||||
}
|
}
|
||||||
if parts.Name != "foo" {
|
if parts.Name != "foo" {
|
||||||
t.Fatalf("bad: %v", parts)
|
t.Fatalf("bad: %v", parts)
|
||||||
|
@ -34,8 +34,8 @@ func TestIsConsulServer(t *testing.T) {
|
||||||
}
|
}
|
||||||
m.Tags["bootstrap"] = "1"
|
m.Tags["bootstrap"] = "1"
|
||||||
m.Tags["disabled"] = "1"
|
m.Tags["disabled"] = "1"
|
||||||
valid, parts = server_details.IsConsulServer(m)
|
ok, parts = server_details.IsConsulServer(m)
|
||||||
if !valid {
|
if !ok {
|
||||||
t.Fatalf("expected a valid consul server")
|
t.Fatalf("expected a valid consul server")
|
||||||
}
|
}
|
||||||
if !parts.Bootstrap {
|
if !parts.Bootstrap {
|
||||||
|
@ -50,8 +50,8 @@ func TestIsConsulServer(t *testing.T) {
|
||||||
m.Tags["expect"] = "3"
|
m.Tags["expect"] = "3"
|
||||||
delete(m.Tags, "bootstrap")
|
delete(m.Tags, "bootstrap")
|
||||||
delete(m.Tags, "disabled")
|
delete(m.Tags, "disabled")
|
||||||
valid, parts = server_details.IsConsulServer(m)
|
ok, parts = server_details.IsConsulServer(m)
|
||||||
if !valid || parts.Expect != 3 {
|
if !ok || parts.Expect != 3 {
|
||||||
t.Fatalf("bad: %v", parts.Expect)
|
t.Fatalf("bad: %v", parts.Expect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue