D
D
di2019-04-21 20:12:12
go
di, 2019-04-21 20:12:12

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
},....]

I see
[
{"isbn":"978-1503261969",
"title":{"String":"Emma","Valid":true},
"author":{"String":"Jayne Austen","Valid":true},
"price":{"Float64":9.44,"Valid":true}},
......]

How do I get the json in the first option?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question