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

Windows support: net #157

Merged
merged 3 commits into from
Feb 8, 2020
Merged

Windows support: net #157

merged 3 commits into from
Feb 8, 2020

Conversation

KingRial
Copy link
Contributor

@KingRial KingRial commented Feb 6, 2020

Added partial windows support to net

Issue #8

Riccardo Re added 3 commits February 6, 2020 17:01
Added partial windows support to net
KingRial pushed a commit to KingRial/ghw that referenced this pull request Feb 7, 2020
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
Copy link
Owner

@jaypipes jaypipes left a 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
Copy link
Owner

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..

Copy link
Contributor Author

@KingRial KingRial Feb 8, 2020

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":

image

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.

Copy link
Owner

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!

@jaypipes jaypipes merged commit 651de2e into jaypipes:master Feb 8, 2020
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.

None yet

2 participants