From 0527474bf6f0f9c3196aae7ad94800b46b5e98e0 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Fri, 4 May 2018 14:16:21 -0700 Subject: [PATCH] Move usage string to internal to fix `go run` --- cmd/telegraf/telegraf.go | 3 ++- {cmd/telegraf => internal}/usage.go | 4 ++-- {cmd/telegraf => internal}/usage_windows.go | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) rename {cmd/telegraf => internal}/usage.go (94%) rename {cmd/telegraf => internal}/usage_windows.go (95%) diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index c38d88c3f..2e6ee3fe8 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -13,6 +13,7 @@ import ( "syscall" "github.com/influxdata/telegraf/agent" + "github.com/influxdata/telegraf/internal" "github.com/influxdata/telegraf/internal/config" "github.com/influxdata/telegraf/logger" _ "github.com/influxdata/telegraf/plugins/aggregators/all" @@ -192,7 +193,7 @@ func reloadLoop( } func usageExit(rc int) { - fmt.Println(usage) + fmt.Println(internal.Usage) os.Exit(rc) } diff --git a/cmd/telegraf/usage.go b/internal/usage.go similarity index 94% rename from cmd/telegraf/usage.go rename to internal/usage.go index 2d36ede94..4c00d8f83 100644 --- a/cmd/telegraf/usage.go +++ b/internal/usage.go @@ -1,8 +1,8 @@ // +build !windows -package main +package internal -const usage = `Telegraf, The plugin-driven server agent for collecting and reporting metrics. +const Usage = `Telegraf, The plugin-driven server agent for collecting and reporting metrics. Usage: diff --git a/cmd/telegraf/usage_windows.go b/internal/usage_windows.go similarity index 95% rename from cmd/telegraf/usage_windows.go rename to internal/usage_windows.go index b09435b9a..109d309ed 100644 --- a/cmd/telegraf/usage_windows.go +++ b/internal/usage_windows.go @@ -1,8 +1,8 @@ // +build windows -package main +package internal -const usage = `Telegraf, The plugin-driven server agent for collecting and reporting metrics. +const Usage = `Telegraf, The plugin-driven server agent for collecting and reporting metrics. Usage: