Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux CPU.Mhz = 0 #1776

Open
tyz-coder opened this issue Jan 14, 2025 · 1 comment
Open

Linux CPU.Mhz = 0 #1776

tyz-coder opened this issue Jan 14, 2025 · 1 comment

Comments

@tyz-coder
Copy link

tyz-coder commented Jan 14, 2025

Need to adapt to 'CPU MHz'
cpu_linux.go:279
case "cpu MHz", "CPU MHz", "clock", "cpu MHz dynamic": // treat this as the fallback value, thus we ignore error if t, err := strconv.ParseFloat(strings.Replace(value, "MHz", "", 1), 64); err == nil { c.Mhz = t }

@tyz-coder
Copy link
Author

Similarly, all keys can be converted to lowercase for judgment, avoiding unpredictable errors caused by changes in the operating system.

cpu_linux.go:188
key := strings.TrimSpace(fields[0]) -> key := strings.ToLower(strings.TrimSpace(fields[0]))

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

No branches or pull requests

1 participant