From 7901677c2c1cf5dcd22ab3785cea3db19aa2f633 Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Fri, 11 Sep 2015 10:16:36 -0700 Subject: [PATCH] command: unexport helpers --- command/helpers.go | 8 ++++---- command/helpers_test.go | 6 +++--- command/status.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/command/helpers.go b/command/helpers.go index 1190c05e7..77d1f99c8 100644 --- a/command/helpers.go +++ b/command/helpers.go @@ -18,9 +18,9 @@ const ( DefaultHttpAddr = "http://127.0.0.1:4646" ) -// HttpAddrFlag is used to add the -http-addr flag to a flag +// httpAddrFlag is used to add the -http-addr flag to a flag // set. Allows setting the value from an environment variable. -func HttpAddrFlag(f *flag.FlagSet) *string { +func httpAddrFlag(f *flag.FlagSet) *string { defaultAddr := os.Getenv(HttpEnvVar) if defaultAddr == "" { defaultAddr = DefaultHttpAddr @@ -29,9 +29,9 @@ func HttpAddrFlag(f *flag.FlagSet) *string { "HTTP address of the Nomad agent") } -// HttpClient is used to get a new Nomad client using the +// httpClient is used to get a new Nomad client using the // given address. -func HttpClient(addr string) (*api.Client, error) { +func httpClient(addr string) (*api.Client, error) { conf := api.DefaultConfig() conf.URL = addr return api.NewClient(conf) diff --git a/command/helpers_test.go b/command/helpers_test.go index 898470437..7020ee125 100644 --- a/command/helpers_test.go +++ b/command/helpers_test.go @@ -11,7 +11,7 @@ func TestHelpers_HttpAddrFlag(t *testing.T) { // Returns the default flags := flag.NewFlagSet("test", flag.ContinueOnError) - addr = HttpAddrFlag(flags) + addr = httpAddrFlag(flags) if err := flags.Parse([]string{}); err != nil { t.Fatalf("err: %s", err) } @@ -24,7 +24,7 @@ func TestHelpers_HttpAddrFlag(t *testing.T) { t.Fatalf("err: %s", err) } flags = flag.NewFlagSet("test", flag.ContinueOnError) - addr = HttpAddrFlag(flags) + addr = httpAddrFlag(flags) if err := flags.Parse([]string{}); err != nil { t.Fatalf("err: %s", err) } @@ -34,7 +34,7 @@ func TestHelpers_HttpAddrFlag(t *testing.T) { // Returns from flag flags = flag.NewFlagSet("test", flag.ContinueOnError) - addr = HttpAddrFlag(flags) + addr = httpAddrFlag(flags) if err := flags.Parse([]string{"-http-addr", "http://127.0.0.1:2222"}); err != nil { t.Fatalf("err: %s", err) } diff --git a/command/status.go b/command/status.go index 9454c244a..0a38e772d 100644 --- a/command/status.go +++ b/command/status.go @@ -42,7 +42,7 @@ func (c *StatusCommand) Run(args []string) int { flags := flag.NewFlagSet("status", flag.ContinueOnError) flags.Usage = func() { c.Ui.Output(c.Help()) } - httpAddr = HttpAddrFlag(flags) + httpAddr = httpAddrFlag(flags) if err := flags.Parse(args); err != nil { return 1 @@ -55,7 +55,7 @@ func (c *StatusCommand) Run(args []string) int { } // Get the HTTP client - client, err := HttpClient(*httpAddr) + client, err := httpClient(*httpAddr) if err != nil { c.Ui.Error(fmt.Sprintf("Failed initializing Nomad client: %s", err)) return 1