I have a really simple JSON file, something like this, but with thousands of strings:
{\"fruits\":[\"apple\",\"banana\",\"cherry\",\"date\"]}
here is example how you can Unmarshal to string list without any struct.
package main
import "fmt"
import "encoding/json"
func main() {
src_json := []byte(`{"fruits":["apple","banana","cherry","date"]}`)
var m map[string][]string
err := json.Unmarshal(src_json, &m)
if err != nil {
panic(err)
}
fmt.Printf("%v", m["fruits"][0]) //apple
}
Or instead of String list you can use
map[string][]interface{}