-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update gomod #276
Update gomod #276
Conversation
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!
However I am wondering if there could ever be a port number bigger than the 16 bit unsigned int? Is it that just on some systems the underlying data type is different?
If so wouldn't it be more straightforward to use int64
as type for the port number and convert this number to an int only for the mDNS library?
We could do some checks against math.MaxInt
for the upper limit before we try to convert the port number.
I would tend to agree with this idea of only converting where you need it. |
To clarify @tomponline, you would prefer that |
Yeah I think that makes sense - as it avoids the variable size of int on non-64 bit platforms (even though in practice it'll most commonly be on 64 bit platforms). |
7e29b0e
to
05ef999
Compare
Fixes the build and follows the precedent set in canonical/lxd#13078. Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
05ef999
to
616d959
Compare
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. Thanks :)
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.
Thanks, looking good!
I chose to cast all the parameters of
util.CanonicalNetworkAddress
to the largerint64
rather than converting all port variables toint64
(as in canonical/lxd#13078) as it prevents needing to cast to a smaller int when calling intomdns
. That said I'm not attached to one approach or another.