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
Make bus types enum constants instead of strings #106
Comments
Modifies the `ghw.Disk` struct's `BusType` attribute to be of type `ghw.BusType` instead of `string`. Creates an "enum" of bus types, including a new PCI bus type which will be useful in future patches for auxiliary devices. Issue #106
@jpo-joyent @yrobla @pwFoo @blp1526 would you all mind doing a quick review of this patch please? If you are using Thank you! |
Change is ok for me . We are not yet using library (although we want to) , but using ghwc CLI tool. |
LGTM. (This |
Yeah, I'm not a fan of that particular Go-ism. Maybe it's my C background but I just like having constants use ALL_CAPS. So, that's not going to change... I might just remove the warning lines for that. |
Yep, broke my code but was trivial to fix. Thank you for giving us a heads up! :) |
Actually no, this breaks macOS again, and in a way that I can not easily fix. In macOS, the bus type is a string that comes from the IOKit BusProtocol field, whose legal values are not documented, and whose source is not available. The only value I've seen is |
The bus types are strings with a mix of uppercase and lowercase runes. Make them constant enums instead.
The text was updated successfully, but these errors were encountered: