We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello !
When using funcr implementation with JSON formatter, produced JSON is invalid when omitting fields using json struct tag.
funcr
json
Go Playground
type Foo struct { Bar string `json:"-"` Baz string `json:"baz"` } func main() { logger := funcr.NewJSON( func(obj string) { fmt.Println(obj) }, funcr.Options{}, ) logger.Info("", "foo", Foo{}) }
{"logger":"","level":0,"msg":"","foo":{"baz":""}}
{"logger":"","level":0,"msg":"","foo":{,"baz":""}}
Notice the extra comma before baz key.
baz
A quick investigation pointed this line as the potential issue.
Thanks for your help !
The text was updated successfully, but these errors were encountered:
Thanks! Fix is pending review.
Sorry, something went wrong.
Thanks a lot for your quick reactivity !
thockin
Successfully merging a pull request may close this issue.
Hello !
When using
funcr
implementation with JSON formatter, produced JSON is invalid when omitting fields usingjson
struct tag.How to reproduce
Go Playground
Expected output
Got output
Notice the extra comma before
baz
key.A quick investigation pointed this line as the potential issue.
Thanks for your help !
The text was updated successfully, but these errors were encountered: