Select Git revision
CollectionsOfCollectionPtrModel.go
-
Md. Alim Ul Karim authored
JsonResult -> Json, JsonResultsCollection ## Introduction JsonResult -> Json, JsonResultsCollection features added, now jsonResult can be saved into or marshal into bytes. JsonResult can be collected as JsonResultsCollection, it can also be marshalled ## Sample Code ```go items := &[]string{ "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", } // collectionPtr := corestr.NewCollectionPtrUsingStrings(items, 0) collection := corestr.NewCollectionUsingStrings(items, false) jsonResults := corejson.NewResultsCollectionUsingJsoners(1, collection) jsonResultFromResults := jsonResults.Json() fmt.Println(jsonResultFromResults.JsonString()) res2 := corejson.EmptyResultsCollection() res2.ParseInjectUsingJson(jsonResultFromResults) fmt.Println(res2.Json().JsonString()) collect2 := corestr.EmptyCollection() // res2.InjectIntoAt(0, collect2) res2.UnmarshalAt(0, collect2) fmt.Println(collect2) ``` ## Output ```notes {"GenericJsonCollection":[{"Bytes":"eyJTdHJpbmdzQ29sbGVjdGlvbiI6WyIwMCIsIjAxIiwiMDIiLCIwMyIsIjA0IiwiMDUiLCIwNiIsIjA3IiwiMDgiLCIwOSIsIjEwIiwiMTEiLCIxMiJdfQ==","Error":"","HasError":false}]} {"GenericJsonCollection":[{"Bytes":"eyJTdHJpbmdzQ29sbGVjdGlvbiI6WyIwMCIsIjAxIiwiMDIiLCIwMyIsIjA0IiwiMDUiLCIwNiIsIjA3IiwiMDgiLCIwOSIsIjEwIiwiMTEiLCIxMiJdfQ==","Error":"","HasError":false}]} - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 Process finished with exit code 0 ``` See merge request !39
Md. Alim Ul Karim authoredJsonResult -> Json, JsonResultsCollection ## Introduction JsonResult -> Json, JsonResultsCollection features added, now jsonResult can be saved into or marshal into bytes. JsonResult can be collected as JsonResultsCollection, it can also be marshalled ## Sample Code ```go items := &[]string{ "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", } // collectionPtr := corestr.NewCollectionPtrUsingStrings(items, 0) collection := corestr.NewCollectionUsingStrings(items, false) jsonResults := corejson.NewResultsCollectionUsingJsoners(1, collection) jsonResultFromResults := jsonResults.Json() fmt.Println(jsonResultFromResults.JsonString()) res2 := corejson.EmptyResultsCollection() res2.ParseInjectUsingJson(jsonResultFromResults) fmt.Println(res2.Json().JsonString()) collect2 := corestr.EmptyCollection() // res2.InjectIntoAt(0, collect2) res2.UnmarshalAt(0, collect2) fmt.Println(collect2) ``` ## Output ```notes {"GenericJsonCollection":[{"Bytes":"eyJTdHJpbmdzQ29sbGVjdGlvbiI6WyIwMCIsIjAxIiwiMDIiLCIwMyIsIjA0IiwiMDUiLCIwNiIsIjA3IiwiMDgiLCIwOSIsIjEwIiwiMTEiLCIxMiJdfQ==","Error":"","HasError":false}]} {"GenericJsonCollection":[{"Bytes":"eyJTdHJpbmdzQ29sbGVjdGlvbiI6WyIwMCIsIjAxIiwiMDIiLCIwMyIsIjA0IiwiMDUiLCIwNiIsIjA3IiwiMDgiLCIwOSIsIjEwIiwiMTEiLCIxMiJdfQ==","Error":"","HasError":false}]} - 00 - 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 Process finished with exit code 0 ``` See merge request !39