Skip to content

Commit 4085da8

Browse files
committed
renaming splitWords to tokens
1 parent ffc46f9 commit 4085da8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/util/metrics/system/cmdline_args.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func splitAfterSpace(inputChar rune) bool {
5555
func CmdlineArgs() ([]CmdlineArg, error) {
5656
lines, err := ReadFileIntoLines(cmdlineFilePath)
5757
if err != nil {
58-
return nil, fmt.Errorf("error reading the file %v, %v", cmdlineFilePath, err)
58+
return nil, fmt.Errorf("error reading the file %s, %v", cmdlineFilePath, err)
5959
}
6060
if len(lines) < 1 {
6161
return nil, fmt.Errorf("no lines are retured")
@@ -68,17 +68,17 @@ func CmdlineArgs() ([]CmdlineArg, error) {
6868
if strings.Index(words, "\"") == 0 {
6969
continue
7070
}
71-
splitsWords := strings.Split(words, "=")
72-
if len(splitsWords) < 2 {
71+
tokens := strings.Split(words, "=")
72+
if len(tokens) < 2 {
7373
var stats = CmdlineArg{
74-
Key: splitsWords[0],
74+
Key: tokens[0],
7575
}
7676
result = append(result, stats)
7777
} else {
7878
//remove quotes in the values
79-
trimmedValue := strings.Trim(splitsWords[1], "\"'")
79+
trimmedValue := strings.Trim(tokens[1], "\"'")
8080
var stats = CmdlineArg{
81-
Key: splitsWords[0],
81+
Key: tokens[0],
8282
Value: trimmedValue,
8383
}
8484
result = append(result, stats)

0 commit comments

Comments
 (0)