From e7359706d41651e6c93e326171712780bfdf4ec3 Mon Sep 17 00:00:00 2001 From: Mikhail Salosin Date: Fri, 6 Nov 2015 19:45:05 +0300 Subject: [PATCH] Do not use flag before flag.Parse() was called --- collector/ntp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/ntp.go b/collector/ntp.go index fb2031f3..1b6c8211 100644 --- a/collector/ntp.go +++ b/collector/ntp.go @@ -35,7 +35,6 @@ type ntpCollector struct { } func init() { - ntp.Version = byte(*ntpProtocolVersion) Factories["ntp"] = NewNtpCollector } @@ -45,6 +44,7 @@ func NewNtpCollector() (Collector, error) { if *ntpServer == "" { return nil, fmt.Errorf("no NTP server specifies, see --ntpServer") } + ntp.Version = byte(*ntpProtocolVersion) return &ntpCollector{ drift: prometheus.NewGauge(prometheus.GaugeOpts{