-
Notifications
You must be signed in to change notification settings - Fork 9
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
Embedded struct error: all fields must have non-empty names #2
Comments
Do you have any thoughts on naming fields of embedded structs in influx, as influx records are flat? |
I think influxdbhelper should flatten embedded structs. The Go compiler supports this strange flattening property of embedded structs. For example, if you have:
In this case, |
This might be helpful: https://stackoverflow.com/questions/24333494/golang-reflection-on-embedded-structs |
agreed, it would be handy to be able to "compose" structs and essentially flatten them for storage in influx. The workaround for now is to create another struct for writing into influx, and then copy your data to that. Since influx schemas are generally not huge, this has not been a big problem. |
If I have a struct that uses "type embedding" to embed another struct, even if the embedded struct has
influx
tags on its fields, influxdbhelper complains:Ideally, embedded structs should be supported.
The text was updated successfully, but these errors were encountered: