Use registry to remove wmi from cpu package - #1929
Merged
Merged
Conversation
Contributor
Author
|
@shirou when you have time can you test with your AMD cpu? |
shirou
requested changes
Oct 12, 2025
| assert.NotEmptyf(t, vv.ModelName, "could not get CPU Info: %v", vv) | ||
| if runtime.GOOS == "windows" { | ||
| assert.NotEmptyf(t, vv.VendorID, "could not get Vendor ID: %v", vv) | ||
| assert.NotEmptyf(t, vv.VendorID, "could not get CPU Family: %v", vv) |
Owner
There was a problem hiding this comment.
Suggested change
| assert.NotEmptyf(t, vv.VendorID, "could not get CPU Family: %v", vv) | |
| assert.NotEmptyf(t, vv.Family, "could not get CPU Family: %v", vv) |
Comment on lines
+223
to
+225
| defer key.Close() | ||
| model = getRegistryStringValueIfUnset(key, "ProcessorNameString", model) | ||
| vendorId = getRegistryStringValueIfUnset(key, "VendorIdentifier", vendorId) |
Owner
There was a problem hiding this comment.
defer will not execute until this function returns, but I think we don’t need to wait for that.
Suggested change
| defer key.Close() | |
| model = getRegistryStringValueIfUnset(key, "ProcessorNameString", model) | |
| vendorId = getRegistryStringValueIfUnset(key, "VendorIdentifier", vendorId) | |
| model = getRegistryStringValueIfUnset(key, "ProcessorNameString", model) | |
| vendorId = getRegistryStringValueIfUnset(key, "VendorIdentifier", vendorId) | |
| key.Close() |
shirou
approved these changes
Oct 16, 2025
shirou
left a comment
Owner
There was a problem hiding this comment.
LGTM! I really appreciate your series of contributions!
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented registry to get model name and vendorId.
Removed wmi from cpu package