From 4085da817d24754f3fadad0e4d0f91ad23e3f013 Mon Sep 17 00:00:00 2001 From: varsha teratipally Date: Tue, 8 Dec 2020 18:34:54 +0000 Subject: [PATCH] renaming splitWords to tokens --- pkg/util/metrics/system/cmdline_args.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/util/metrics/system/cmdline_args.go b/pkg/util/metrics/system/cmdline_args.go index 895ed1ba..792261b3 100644 --- a/pkg/util/metrics/system/cmdline_args.go +++ b/pkg/util/metrics/system/cmdline_args.go @@ -55,7 +55,7 @@ func splitAfterSpace(inputChar rune) bool { func CmdlineArgs() ([]CmdlineArg, error) { lines, err := ReadFileIntoLines(cmdlineFilePath) if err != nil { - return nil, fmt.Errorf("error reading the file %v, %v", cmdlineFilePath, err) + return nil, fmt.Errorf("error reading the file %s, %v", cmdlineFilePath, err) } if len(lines) < 1 { return nil, fmt.Errorf("no lines are retured") @@ -68,17 +68,17 @@ func CmdlineArgs() ([]CmdlineArg, error) { if strings.Index(words, "\"") == 0 { continue } - splitsWords := strings.Split(words, "=") - if len(splitsWords) < 2 { + tokens := strings.Split(words, "=") + if len(tokens) < 2 { var stats = CmdlineArg{ - Key: splitsWords[0], + Key: tokens[0], } result = append(result, stats) } else { //remove quotes in the values - trimmedValue := strings.Trim(splitsWords[1], "\"'") + trimmedValue := strings.Trim(tokens[1], "\"'") var stats = CmdlineArg{ - Key: splitsWords[0], + Key: tokens[0], Value: trimmedValue, } result = append(result, stats)