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

     1  package main
     2  
     3  import (
     4  	"errors"
     5  	"fmt"
     6  
     7  	"gitlab.com/evatix-go/core/coredata/corejson"
     8  )
     9  
    10  func jsonResultPrettyTest01() {
    11  	mapAnyItems := getMapAnyItems()
    12  	jsonResult := mapAnyItems.JsonPtr()
    13  
    14  	fmt.Println(jsonResult.PrettyJsonStringOrErrString())
    15  
    16  	var rs2 *corejson.Result
    17  
    18  	fmt.Println(rs2.PrettyJsonStringOrErrString())
    19  
    20  	rs2 = corejson.NewResult.Ptr([]byte{}, errors.New("something wrong"), "t1")
    21  
    22  	fmt.Println(rs2.PrettyJsonStringOrErrString())
    23  
    24  	rs2 = corejson.NewResult.Ptr(nil, errors.New("something wrong"), "t1")
    25  
    26  	fmt.Println(rs2.PrettyJsonStringOrErrString())
    27  }