diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-08-28 10:17:43 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-08-28 11:33:16 -0400 |
| commit | 9d66b91282a0967fb815aaf7ae2de054551dbabd (patch) | |
| tree | 7e807abf5d2462d36fff4560633bbb2ca8766172 /conv | |
| parent | c7a9e4c13a75c67a281d00b91f022618273eb604 (diff) | |
Updating gometalinter config and fixing new lint errors
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'conv')
| -rw-r--r-- | conv/conv.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/conv/conv.go b/conv/conv.go index e716ea13..5db95976 100644 --- a/conv/conv.go +++ b/conv/conv.go @@ -119,8 +119,7 @@ func Has(in interface{}, key interface{}) bool { case reflect.Slice, reflect.Array: l := av.Len() for i := 0; i < l; i++ { - var v interface{} - v = av.Index(i).Interface() + v := av.Index(i).Interface() if reflect.DeepEqual(v, key) { return true } @@ -160,24 +159,28 @@ func ToStrings(in ...interface{}) []string { // MustParseInt - wrapper for strconv.ParseInt that returns 0 in the case of error func MustParseInt(s string, base, bitSize int) int64 { + // nolint: gosec i, _ := strconv.ParseInt(s, base, bitSize) return i } // MustParseFloat - wrapper for strconv.ParseFloat that returns 0 in the case of error func MustParseFloat(s string, bitSize int) float64 { + // nolint: gosec i, _ := strconv.ParseFloat(s, bitSize) return i } // MustParseUint - wrapper for strconv.ParseUint that returns 0 in the case of error func MustParseUint(s string, base, bitSize int) uint64 { + // nolint: gosec i, _ := strconv.ParseUint(s, base, bitSize) return i } // MustAtoi - wrapper for strconv.Atoi that returns 0 in the case of error func MustAtoi(s string) int { + // nolint: gosec i, _ := strconv.Atoi(s) return i } |
