gitlab.com/evatix-go/core@v1.3.55/cmd/main/jsonResultUnmarshallingTest02.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"gitlab.com/evatix-go/core/coredata/coredynamic"
     7  )
     8  
     9  func jsonResultUnmarshallingTest02() {
    10  	mapAnyItems := getMapAnyItems()
    11  	jsonResult := mapAnyItems.JsonPtr()
    12  	var emptyMapResult *coredynamic.MapAnyItems
    13  
    14  	err := jsonResult.Unmarshal(emptyMapResult)
    15  	fmt.Println("err:", err)
    16  	fmt.Println(emptyMapResult)
    17  
    18  	var emptyMapResult2 coredynamic.MapAnyItems
    19  
    20  	err2 := jsonResult.Unmarshal(emptyMapResult2)
    21  	fmt.Println("err2:", err2)
    22  	fmt.Println(emptyMapResult2)
    23  
    24  	var emptyMapResult3 coredynamic.MapAnyItems
    25  
    26  	err3 := jsonResult.Unmarshal(&emptyMapResult3)
    27  	fmt.Println("err3:", err3)
    28  	fmt.Println(emptyMapResult3)
    29  
    30  	err4 := emptyMapResult3.JsonParseSelfInject(jsonResult)
    31  	fmt.Println("err4:", err4)
    32  	fmt.Println("emptyMapResult3:", emptyMapResult3)
    33  
    34  	err5 := emptyMapResult3.JsonParseSelfInject(nil)
    35  	fmt.Println("err5:", err5)
    36  	fmt.Println("emptyMapResult3:", emptyMapResult3)
    37  
    38  	err6 := emptyMapResult.JsonParseSelfInject(jsonResult)
    39  	fmt.Println("nil emptyMapResult err6:", err6)
    40  
    41  	jsonResult = nil
    42  	err7 := jsonResult.Unmarshal(&emptyMapResult3)
    43  	fmt.Println("json Result nil, err7:", err7)
    44  
    45  	jsonResult = nil
    46  	err8 := jsonResult.Unmarshal(emptyMapResult)
    47  	fmt.Println("json Result, object nil, err8:", err8)
    48  }