Get array response back in golang

259 views
Skip to first unread message

Vick Vicky

unread,
Sep 19, 2022, 10:01:33 PM9/19/22
to golang-nuts
hey there!
how i can get array in response e.g
{
"make":["Toyota","Honda"....]
"model":[1992,2001,....]
"year":[2021,2012....]
}

Kurtis Rader

unread,
Sep 19, 2022, 10:50:16 PM9/19/22
to Vick Vicky, golang-nuts
Insufficient information. It looks like your question involves handling JSON data structures but beyond that no one is going to be able to provide any useful advice. Can you provide a small code example for what you have tried? Can you elaborate on what you mean by "in response"? Are you making a HTTP request that returns JSON and you are having trouble parsing the result into equivalent Go data structures?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5b5c1c8a-6777-4e18-82b2-c4be03576466n%40googlegroups.com.


--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Wissem belg

unread,
Sep 20, 2022, 10:13:36 AM9/20/22
to golang-nuts
This is not an array.. this is a map that contains arrays.. You can get this JSON by marshelling an object of type map[string][]string
Reply all
Reply to author
Forward
0 new messages