fluent-logger-golang icon indicating copy to clipboard operation
fluent-logger-golang copied to clipboard

Passing struct pointers to `Post` method

Open dearoneesama opened this issue 4 years ago • 1 comments

I noticed that the Post method only supports passing values typed as interface{}, for example, only doing this is valid:

ptr := &struct{}{}
fluent.Post("tag", *ptr)

and passes this check

https://github.com/fluent/fluent-logger-golang/blob/993443fa213dcb480cf07fef6aaad3834246a7ea/fluent/fluent.go#L206-L209

Passing pointers generates error instead. Can we support passing a struct pointer (use .Elem().Field() to get its fields) and if not, what are possible concerns?

dearoneesama avatar Oct 14 '21 22:10 dearoneesama

It will panicking on fluentd sys core

batara666 avatar Oct 20 '21 10:10 batara666