-
Notifications
You must be signed in to change notification settings - Fork 258
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
osversion: implement stringer interface, deprecate ToString() #1547
Conversation
/cc @tianon 😄 |
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.
LGTM. Super funny. I had no idea this wasnt already the String interface. Likely @lowenna's fault haha
BTW, nothing but love for you JH! |
So funny |
osversion/osversion_windows_test.go
Outdated
|
||
func TestOSVersionString(t *testing.T) { | ||
v := OSVersion{ | ||
Version: 123, |
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.
Technically, this should be 809042555
(123 | (2 << 8) | (12345 << 16)
), but I think you can just set it to zero for this test
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.
Ah, good one; yes I can set it to 809042555
(I wanted to avoid setting it to 0
, as that's the default value, and such values could e.g. be ignored / omit-empty-like things).
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.
Updated 👍 ptal
This allows the type to be used with fm.Sprintf() and similar uses. Signed-off-by: Sebastiaan van Stijn <[email protected]>
b5fefbb
to
d91924f
Compare
|
This allows the type to be used with fm.Sprintf() and similar uses.
To preview the GoDoc (pkg.go.dev);
GOOS=windows pkgsite -http=:6060 .