-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
internal: move syscall.Conn wrapper into a separate package #2457
Conversation
Looks like you're missing a build tag based on travis. Please reassign after fixing. |
* | ||
*/ | ||
|
||
package internal |
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.
Token package comment?
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.
Done.
credentials/internal/syscallconn.go
Outdated
rawConn net.Conn | ||
} | ||
|
||
// WrapSyscallConn tries to wrapper rawConn and newConn into a net.Conn that |
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.
wrapper->wrap
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.
Done
credentials/internal/syscallconn.go
Outdated
// help here). | ||
type syscallConn struct { | ||
net.Conn | ||
rawConn net.Conn |
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.
can this be an embedded syscall.Conn
instead, and then we don't even need to implement the method manually?
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.
Done
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.
If you embed the syscall.Conn
instead of naming the field, you won't need to define the method at all.
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.
Hmm, good idea.
But they are all named Conn
(net.Conn
vs syscall.Conn
), and are "duplicate fields"...
@@ -0,0 +1,67 @@ | |||
// +build !appengine |
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.
"OR Go1.11"? With the other being "AND !Go1.11"?
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.
Actually, let's save this for a later PR.
Also skip wrapping if
rawConn
doesn't implementsyscall.Conn
.