From f7b4621f8166ce550ca135fe0d64ba5df23f40d8 Mon Sep 17 00:00:00 2001 From: TJ Hoplock Date: Mon, 25 Sep 2023 23:54:42 -0400 Subject: [PATCH] ref(meminfo): simplify variable assignment Addresses PR feedback https://github.com/prometheus/procfs/pull/569#discussion_r1336227047 Signed-off-by: TJ Hoplock --- meminfo.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meminfo.go b/meminfo.go index cccdfcd0..ec00a624 100644 --- a/meminfo.go +++ b/meminfo.go @@ -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.