You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question, I have a func have gjson object parameter,for example:
type mapJSONTest struct {
Test map[int]int
}
func convertStruct(obj *gjson.Json) {
// how can convert obj to mapJSONTest
// of course I can
//var gobj mapJSONTest
// body, _ := obj.ToJson()
//gjson.DecodeTo(body, &gobj)
}
I have a question, I have a func have gjson object parameter,for example:
type mapJSONTest struct {
Test map[int]int
}
func convertStruct(obj *gjson.Json) {
// how can convert obj to mapJSONTest
// of course I can
//var gobj mapJSONTest
// body, _ := obj.ToJson()
//gjson.DecodeTo(body, &gobj)
}
func main() {
mapTest := make(map[int]int)
mapTest[1000] = 2
mapTest[2000] = 4
testObj := mapJSONTest{}
testObj.Test = mapTest
}
The text was updated successfully, but these errors were encountered: