Skip to content

Commit

Permalink
clean up a couple loose ends
Browse files Browse the repository at this point in the history
  • Loading branch information
DStrand1 committed May 21, 2024
1 parent 3bd1a91 commit f592e38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ func isQuitting(ctx context.Context) bool {
}

func defaultReadPipe(r io.Reader) {
//nolint:errcheck // Discarding the data, no need to handle an error
_, _ = io.Copy(io.Discard, r)
}
7 changes: 4 additions & 3 deletions internal/snmp/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func (f *Field) Convert(ent gosnmp.SnmpPDU) (v interface{}, err error) {

if f.Conversion == "int" {
v = ent.Value
err = nil
switch vt := v.(type) {
case float32:
v = int64(vt)
Expand All @@ -172,11 +173,11 @@ func (f *Field) Convert(ent gosnmp.SnmpPDU) (v interface{}, err error) {
case uint64:
v = int64(vt)
case []byte:
v, _ = strconv.ParseInt(string(vt), 10, 64)
v, err = strconv.ParseInt(string(vt), 10, 64)
case string:
v, _ = strconv.ParseInt(vt, 10, 64)
v, err = strconv.ParseInt(vt, 10, 64)
}
return v, nil
return v, err
}

if f.Conversion == "hwaddr" {
Expand Down

0 comments on commit f592e38

Please sign in to comment.