Fix all open go lint and vet issues

This commit is contained in:
Tobias Schmidt 2017-02-28 12:44:53 -04:00
commit c703435790
37 changed files with 136 additions and 129 deletions

View file

@ -56,10 +56,8 @@ func evalStatusline(statusline string) (active, total, size int64, err error) {
// +1 to make it more obvious that the whole string containing the info is also returned as matches[0].
if len(matches) < 3+1 {
return 0, 0, 0, fmt.Errorf("too few matches found in statusline: %s", statusline)
} else {
if len(matches) > 3+1 {
return 0, 0, 0, fmt.Errorf("too many matches found in statusline: %s", statusline)
}
} else if len(matches) > 3+1 {
return 0, 0, 0, fmt.Errorf("too many matches found in statusline: %s", statusline)
}
size, err = strconv.ParseInt(matches[1], 10, 64)
@ -109,7 +107,7 @@ func evalUnknownPersonalitylineRE(statusline string) (size int64, err error) {
return size, nil
}
// Gets the size that has already been synced out of the sync-line.
// evalBuildline gets the size that has already been synced out of the sync-line.
func evalBuildline(buildline string) (int64, error) {
matches := buildlineRE.FindStringSubmatch(buildline)
@ -131,7 +129,7 @@ func evalBuildline(buildline string) (int64, error) {
return syncedSize, nil
}
// Parses an mdstat-file and returns a struct with the relevant infos.
// parseMdstat parses an mdstat-file and returns a struct with the relevant infos.
func parseMdstat(mdStatusFilePath string) ([]mdStatus, error) {
content, err := ioutil.ReadFile(mdStatusFilePath)
if err != nil {
@ -234,7 +232,7 @@ func parseMdstat(mdStatusFilePath string) ([]mdStatus, error) {
return mdStates, nil
}
// Just returns the pointer to an empty struct as we only use throwaway-metrics.
// NewMdadmCollector returns a new Collector exposing raid statistics.
func NewMdadmCollector() (Collector, error) {
return &mdadmCollector{}, nil
}