If you need to unmarshal arbitrary JSON or YAML data (e.g. consuming data from a REST/JSON endpoint with no defined schema) then <a href="https://github.com/twpayne/go-jsonstruct">https://github.com/twpayne/go-jsonstruct</a> will automatically create your Go structs for you. What's special about go-jsonstruct compared to other JSON-to-Go generators, is that go-jsonstruct can accept multiple documents as input and generate the most specific Go struct into which all of the documents can be unmarshalled. You can give it a few example responses from your REST/JSON endpoint and go-jsonstruct will infer the struct for you.