-
Notifications
You must be signed in to change notification settings - Fork 180
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
Windows support: net #157
Windows support: net #157
Conversation
Added partial windows support to net
When collecting HW informations about NICs it's also very usefull to know their current configurations. Here a quick example based on my "Windows support: net" jaypipes#157
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small request inline about the NIC name. Otherwise everything looks excellent.
func (ctx *context) netDeviceName(description win32NetworkAdapter) string { | ||
var name string | ||
if strings.TrimSpace(description.NetConnectionID) != "" { | ||
name = description.NetConnectionID + " - " + description.Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would probably be better to just use NetConnectionID
here and not append the Description
field if NetConnectionID
is non-null. Otherwise it's likely you'll end up with NICs named "Wired Connection - Wired Connection" or something like that..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was at the same idea at first, but during some tests on the field I found out that their union was more usefull (and sometimes, even mandatory).
Here a quick example on Windows Machine using the command "go run .\cmd\ghwc\main.go -f yaml net":
As you can see, their union often deepens the description of the device.
The Latins said: "Melius abundare quam deficere"
We could leave their union in the "name" field or hypothesize a new field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) OK, you'd convinced me, Riccardo!
Added partial windows support to net
Issue #8