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

chore: adding any function to context #580

Merged
merged 2 commits into from Aug 18, 2023
Merged

chore: adding any function to context #580

merged 2 commits into from Aug 18, 2023

Conversation

shettyh
Copy link
Contributor

@shettyh shettyh commented Aug 18, 2023

fix #576

context.go Outdated
@@ -379,6 +379,12 @@ func (c Context) Interface(key string, i interface{}) Context {
return c
}

// Any is a wrapper around Context.Interface.
func (c Context) Any(key string, i interface{}) Context {
c.l.context = enc.AppendInterface(enc.AppendKey(c.l.context, key), i)
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment is saying that this is a wrapper around Context.Interface but you copied its implementation and you are not calling into Context.Interface? I think you can just call into Context.Interface? Compiler will probably inline this anyway.

Copy link
Contributor Author

@shettyh shettyh Aug 18, 2023

Choose a reason for hiding this comment

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

Yes, fixed it

@shettyh shettyh requested a review from mitar August 18, 2023 12:51
@rs rs merged commit 802c88f into rs:master Aug 18, 2023
4 checks passed
madkins23 pushed a commit to madkins23/zerolog that referenced this pull request Mar 2, 2024
* chore: adding any function to context
* fixes
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.

Add context function for any
3 participants