Answer the question
In order to leave comments, you need to log in
How can I get the json I need?
The whole example is here - https://github.com/Delgus/go-postgres-example
The main script is here - https://github.com/Delgus/go-postgres-example/blob...
In general, in main.go the following The code json.NewEncoder(w).Encode(bks)
returns an unexpected result for me.
I expected to see
[
{
"isbn":"978-1503261969",
"title":"Emma",
"author":"Jayne Austen",
"price":9.44
},....]
[
{"isbn":"978-1503261969",
"title":{"String":"Emma","Valid":true},
"author":{"String":"Jayne Austen","Valid":true},
"price":{"Float64":9.44,"Valid":true}},
......]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question