Skip to content

Commit

Permalink
change: strconv.Atoi
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardoMrMu authored and Mu Huai committed May 21, 2024
1 parent 7fd6436 commit 3d99d97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/exporter/nettop/netns.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func getNsInumByPid(pid int) (int, error) {
}

if fields[0] == "net" {
inode, err := strconv.ParseUint(strings.Trim(fields[1], "[]"), 10, 32)
inode, err := strconv.Atoi(strings.Trim(fields[1], "[]"))
if err != nil {
return 0, fmt.Errorf("failed to parse inode from %q: %w", fields[1], err)
}

return int(inode), nil
return inode, nil
}

return 0, fmt.Errorf("net namespace of %d not found", pid)
Expand Down

0 comments on commit 3d99d97

Please sign in to comment.