Fix few vet errors.

There are quite a few 'composite literal uses unkeyed fields' errors that I have kept out of this patch.
And there's a couple where vet just seems confused. These are the easiest ones.
This commit is contained in:
Rohit Jnagal
2015-01-07 08:40:16 +00:00
parent 4c57ec0f56
commit 62ecd5f3ff
9 changed files with 11 additions and 12 deletions

View File

@@ -141,11 +141,11 @@ func CompileRegexps(regexpStrings []string) ([]*regexp.Regexp, error) {
// Writes 'value' to /proc/self/oom_score_adj.
func ApplyOomScoreAdj(value int) error {
if value < -1000 || value > 1000 {
return fmt.Errorf("invalid value(%d) specified for oom_score_adj. Values must be within the range [-1000, 1000]")
return fmt.Errorf("invalid value(%d) specified for oom_score_adj. Values must be within the range [-1000, 1000]", value)
}
if err := ioutil.WriteFile("/proc/self/oom_score_adj", []byte(strconv.Itoa(value)), 0700); err != nil {
fmt.Errorf("failed to set oom_score_adj to %s - %q", value, err)
fmt.Errorf("failed to set oom_score_adj to %d - %q", value, err)
}
return nil