diff --git a/Makefile b/Makefile index 87bd03d65..69d8e7c94 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,8 @@ lint: deps for os in "$(BUILD_OS_TARGETS)"; do \ if [ $$os != "windows" ]; then \ GOOS=$$os golint ./... | tee -a $(LINT_RET); \ + else \ + GOOS=$$os golint --min_confidence=0.9 ./... | tee -a $(LINT_RET); \ fi \ done test ! -s $(LINT_RET) diff --git a/metrics/windows/disk.go b/metrics/windows/disk.go index 080ea4616..ead89eae0 100644 --- a/metrics/windows/disk.go +++ b/metrics/windows/disk.go @@ -79,10 +79,9 @@ func NewDiskGenerator(interval time.Duration) (*DiskGenerator, error) { if r == windows.PDH_NO_DATA { diskLogger.Infof("this metric has not data. ") return nil, err - } else { - diskLogger.Criticalf(err.Error()) - return nil, err } + diskLogger.Criticalf(err.Error()) + return nil, err } return g, nil @@ -98,9 +97,8 @@ func (g *DiskGenerator) Generate() (metrics.Values, error) { if r == windows.PDH_NO_DATA { diskLogger.Infof("this metric has not data. ") return nil, err - } else { - return nil, err } + return nil, err } results := make(map[string]float64) diff --git a/metrics/windows/interface.go b/metrics/windows/interface.go index f3ae9f042..644466604 100644 --- a/metrics/windows/interface.go +++ b/metrics/windows/interface.go @@ -83,10 +83,9 @@ func NewInterfaceGenerator(interval time.Duration) (*InterfaceGenerator, error) if r == windows.PDH_NO_DATA { interfaceLogger.Infof("this metric has not data. ") return nil, err - } else { - interfaceLogger.Criticalf(err.Error()) - return nil, err } + interfaceLogger.Criticalf(err.Error()) + return nil, err } return g, nil @@ -103,9 +102,8 @@ func (g *InterfaceGenerator) Generate() (metrics.Values, error) { if r == windows.PDH_NO_DATA { interfaceLogger.Infof("this metric has not data. ") return nil, err - } else { - return nil, err } + return nil, err } results := make(map[string]float64) diff --git a/metrics/windows/loadavg5.go b/metrics/windows/loadavg5.go index b9518c82c..30ae99d97 100644 --- a/metrics/windows/loadavg5.go +++ b/metrics/windows/loadavg5.go @@ -47,9 +47,8 @@ func (g *Loadavg5Generator) Generate() (metrics.Values, error) { if r == windows.PDH_NO_DATA { loadavg5Logger.Infof("this metric has not data. ") return nil, err - } else { - return nil, err } + return nil, err } results := make(map[string]float64)