-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
use golang.org/x/sys/unix instead of syscall #2927
Conversation
conn_ecn.go
Outdated
@@ -29,7 +31,7 @@ func inspectReadBuffer(c net.PacketConn) (int, error) { | |||
var size int | |||
var serr error | |||
if err := rawConn.Control(func(fd uintptr) { | |||
size, serr = syscall.GetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVBUF) | |||
size, serr = unix.GetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVBUF) |
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.
These constants exist in the unix package also, for consistency.
size, serr = unix.GetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVBUF) | |
size, serr = unix.GetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_RCVBUF) |
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.
Thank you, missed that one!
Codecov Report
@@ Coverage Diff @@
## master #2927 +/- ##
==========================================
+ Coverage 86.24% 86.61% +0.37%
==========================================
Files 133 132 -1
Lines 9143 9378 +235
==========================================
+ Hits 7885 8122 +237
+ Misses 910 907 -3
- Partials 348 349 +1
Continue to review full report at Codecov.
|
48bc453
to
6eca82a
Compare
Looks like I was too optimistic here. That means we'll still need OS-specific files to set the |
6eca82a
to
0716410
Compare
0716410
to
f59cd92
Compare
As suggested by @mvdan in #2896 (review). An excellent suggestion, as it allows us to get rid of two OS-specific files.