Skip to content

Commit

Permalink
ref(meminfo): simplify variable assignment
Browse files Browse the repository at this point in the history
Addresses PR feedback
#569 (comment)

Signed-off-by: TJ Hoplock <[email protected]>
  • Loading branch information
tjhop committed Sep 26, 2023
1 parent 2c71ced commit f7b4621
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions meminfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,11 @@ func parseMemInfo(r io.Reader) (*Meminfo, error) {
fields := strings.Fields(s.Text())
var val, valBytes uint64

v, err := strconv.ParseUint(fields[1], 0, 64)
val, err := strconv.ParseUint(fields[1], 0, 64)
if err != nil {
return nil, err
}

val = v

switch len(fields) {
case 2:
// No unit present, use the parsed the value as bytes directly.
Expand Down

0 comments on commit f7b4621

Please sign in to comment.