Skip to content
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

make RequestCtx's userdata accept keys that are of type: interface{} #1387

Merged
merged 1 commit into from Oct 6, 2022
Merged

Conversation

pjebs
Copy link
Contributor

@pjebs pjebs commented Sep 30, 2022

See: #1385

server.go Outdated
@@ -702,7 +702,7 @@ func (ctx *RequestCtx) UserValueBytes(key []byte) interface{} {
//
// visitor must not retain references to key and value after returning.
// Make key and/or value copies if you need storing them after returning.
func (ctx *RequestCtx) VisitUserValues(visitor func([]byte, interface{})) {
func (ctx *RequestCtx) VisitUserValues(visitor func(interface{}, interface{})) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a backwards incompatible change that I don't want to make. Maybe this should only visit the values that have a []byte key and another method should be added for all values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikdubbelboer Change made.

@erikdubbelboer erikdubbelboer merged commit d404f2d into valyala:master Oct 6, 2022
@erikdubbelboer
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants