Answer the question
In order to leave comments, you need to log in
Is there a quick way to create structures for parsing JSON in Golang?
Often when working with some kind of API in the JSON response there are 20-30 different lines, given that there are most likely nested structures and fields of the SQL DATETIME type, then to parse one response, you need to describe 3-5 structures, and a good half an hour of hammering on the keyboard, and the IDE doesn't really help with that. Maybe someone knows an easy way to create structures from JSON?
PS I just started learning Go, but working with JSON is something that is required very often.
Answer the question
In order to leave comments, you need to log in
If you are working with JSON and you don't need some of the data, you can describe it as json.RawMessage
. Sometimes, if the response from the server comes with a large nesting depth, and the part we need lies somewhere on the surface, we can get to it by describing the unnecessary parts as json.RawMessage
a type.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question