Skip to content

procfs: fix parseStat comment and reuse line variable - #855

Open
zanarellidev wants to merge 1 commit into
prometheus:masterfrom
zanarellidev:fix/parseStat-comment-and-fields
Open

procfs: fix parseStat comment and reuse line variable#855
zanarellidev wants to merge 1 commit into
prometheus:masterfrom
zanarellidev:fix/parseStat-comment-and-fields

Conversation

@zanarellidev

@zanarellidev zanarellidev commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Fixes the inaccurate parseStat comment (it parses /proc/stat, not /proc/[pid]/stat) and reuses the line variable for strings.Fields.

Fixes #845

Test plan

  • go test -run 'TestStat$' .

parseStat reads /proc/stat, not /proc/[pid]/stat. Also use the existing
line variable with strings.Fields instead of calling scanner.Text twice.

Signed-off-by: zanarelli <zanarelli.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A small nitpick and a redundant method call in func parseStat()

1 participant