This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I'm writing a web service that filters a JSON array from from another source. The array of objects contains some common fields, that I want to filter on. It also includes a type discriminator. Depending on type they have a number of other fields that I don't need in my process, but I cannot lose when I render the output to JSON again. It would be brittle for me to try to codify each type as a struct in my application because there are dozens of possible types and they can change without my knowledge. Right now, I'm treating it as a map[string]interface{} but I'm thinking there has to be a more elegant way.
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/golang/comm...