Skip to content
Snippets Groups Projects

"Make necessary changes for PathsChmods + Add new constants + Add interfaces for future usages + Dynamic Type"

Compare and Show latest version
4 files
+ 52
47
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 45
42
@@ -3,58 +3,61 @@ package main
import (
"fmt"
"gitlab.com/evatix-go/core/constants"
"gitlab.com/evatix-go/core/coredata/coredynamic"
"gitlab.com/evatix-go/core/coredata/corejson"
"gitlab.com/evatix-go/core/coredata/corestr"
)
func main() {
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)
res2.UnmarshalIntoSameIndex(collect2)
fmt.Println(collect2)
// 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)
// res2.UnmarshalIntoSameIndex(collect2)
//
// fmt.Println(collect2)
// PrintCollection(collection)
moredata3 := map[int]string{1: "one", 2: "two", 3: "three", 4: "four"}
result := coredynamic.
NewSimpleResult(moredata3, true, "err")
maps, _ := result.
MapToKeyVal()
fmt.Printf(constants.SprintPropertyNameValueFormat, maps)
NewSimpleResult(moredata3, false, "err")
// maps, _ := result.
// MapToKeyVal()
// fmt.Printf(constants.SprintPropertyNameValueFormat, maps)
fmt.Println(result.Length())
// fmt.Println(result.IsSliceOrArray())
// fmt.Println(result.IsMap())
// fmt.Println(result.InvalidError())
// fmt.Println(result.GetErrorOnTypeMismatch(reflect.TypeOf(map[int]string{}), true))
}
func PrintCollection(collection *corestr.Collection) {
Loading