-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Feature]: generic Conn context #443
Comments
这个应该不太好做。需要兼容go原生的context |
// import "context" |
This issue is marked as stale because it has been open for 30 days with no activity. You should take one of the following actions:
This issue will be automatically closed in 7 days if no further activity occurs. |
This issue is marked as stale because it has been open for 30 days with no activity. You should take one of the following actions:
This issue will be automatically closed in 7 days if no further activity occurs. |
This issue is marked as stale because it has been open for 30 days with no activity. You should take one of the following actions:
This issue will be automatically closed in 7 days if no further activity occurs. |
Description of new feature
Would be great if the
Conn
was a generic interface.Like:
This'll allow users avoid many conversions (and many small allocs) when context used.
This is a breaking change, but in soft manner. Since you can maintain the
ConnG
and theConn
separately and theConn
will be almost identical to currentConn
that useinterface{}
to a context.You can get incompatibility here, but mostly in advanced use-cases when some tool rely on the
Conn
internal representation.Also, the change will require the golang version bump to
1.18
. You can also maintain compatibility if you leave the originalConn
implementation and guard it via build tags.Scenarios for new feature
Conn
and nothing should changes for them.interface{}
asContext
. Same as above.interface{}
to the own type.Breaking changes or not?
Yes
Code snippets (optional)
No response
Alternatives for new feature
None.
Additional context (optional)
Good example of same change can be found here.
The text was updated successfully, but these errors were encountered: