Skip to content

Commit

Permalink
Merge pull request #69 from mackerelio/windows-lint
Browse files Browse the repository at this point in the history
fix syntax for linter friendly
  • Loading branch information
Songmu committed Feb 25, 2015
2 parents b31d400 + 179a5aa commit c6ffde9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions metrics/windows/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions metrics/windows/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions metrics/windows/loadavg5.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c6ffde9

Please sign in to comment.