You may need to use the reflect package to check data types in the resulting array/map. It looks tedious, but seems that is the only way out. I have pasted below some quick and dirt, but runnable code to illustrate the same:
package main
import (
"encoding/json"
"fmt"
"reflect"
)
func parsePrintArray(y interface{}) {
var dummy []interface{}
var dummy2 map[string]interface{}
if reflect.TypeOf(y) == reflect.TypeOf("") {
fmt.Printf("%s ", y)
return
}
if reflect.TypeOf(y) == reflect.TypeOf(dummy2) {
x := y.(map[string]interface{})
for ks, vi := range x {
fmt.Printf("
dumping for key %s ", ks)
if vi != nil {
parsePrintArray(vi)
}
}
return
}
for k, yl := range y.([]interface{}) {
if reflect.TypeOf(yl) == reflect.TypeOf(dummy) {
fmt.Println("")
parsePrintArray(yl.([]interface{}))
} else if reflect.TypeOf(yl) == reflect.TypeOf("") {
fmt.Printf("%v: %s ", k, yl.(string))
} else if reflect.TypeOf(yl) == reflect.TypeOf(dummy2) {
x := yl.(map[string]interface{})
for ks, vi := range x {
fmt.Printf("
dumping for key %s ", ks)
if vi != nil {
parsePrintArray(vi)
}
}
}
}
}
func main() {
x := "[[[\"row 1 value1\",{\"Border\":null,\"Fill\":{\"arrFill\":{\"BgColor\":\"red\"}},\"Font\":null,\"ApplyBorder\":null}],\"row 1 value2\",\"row 1 value 3\"],[\"row 2 value 1\",\"row 2 value 2\",\"row 2 value 3\"]]"
var y []interface{}
err := json.Unmarshal([]byte(x), &y)
if err != nil {
panic(err)
}
parsePrintArray(y)
fmt.Println("")
}