fix review

This commit is contained in:
Linh Vo 2017-05-25 12:07:09 -05:00
parent 0a19e9f413
commit 51db1c7784
2 changed files with 6 additions and 6 deletions

View file

@ -126,7 +126,7 @@ func setAllConfig(v *viper.Viper, flags *pflag.FlagSet, envPrefix string) error
for _, key := range v.AllKeys() {
if _, ok := validTags[key]; !ok {
return fmt.Errorf("invalid tag: %v", key)
return fmt.Errorf("invalid option in configuration file: %v", key)
}
}

View file

@ -178,20 +178,20 @@ func TestRootCommand_Config(t *testing.T) {
panic(err)
}
config := `data-dir = "/tmp/pil5_0"
bind = "127.0.0.1:15000"
bind = "127.0.0.1:10101"
[cluster]
poll-interval = "2m0s"
replicas = 2
partitions = 128
hosts = [
"127.0.0.1:15000",
"127.0.0.1:15001",
"127.0.0.1:10101",
"127.0.0.1:10111",
]`
file.Write([]byte(config))
file.Close()
_, err = ExecNewRootCommand(t, "server", "--config", file.Name())
if err.Error() != "invalid tag: cluster.partitions" {
t.Fatalf("Expected invalid tag, but err: '%v'", err)
if err.Error() != "invalid option in configuration file: cluster.partitions" {
t.Fatalf("Expected invalid option in configuration file, but err: '%v'", err)
}
}