From 51db1c77848327981a0eeb412401dfbbfde0603e Mon Sep 17 00:00:00 2001 From: Linh Vo Date: Thu, 25 May 2017 12:07:09 -0500 Subject: [PATCH] fix review --- cmd/root.go | 2 +- cmd/root_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index e506f2fed..a34e8b0c7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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) } } diff --git a/cmd/root_test.go b/cmd/root_test.go index d3aeeab1f..e1aaaf31d 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -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) } }