gitlab.com/evatix-go/core@v1.3.55/cmd/main/readWriteTest01.go (about) 1 package main 2 3 import ( 4 "fmt" 5 6 "gitlab.com/evatix-go/core/chmodhelper" 7 "gitlab.com/evatix-go/core/errcore" 8 ) 9 10 func readWriteTest01() { 11 fmt.Println(chmodhelper.FileModeFriendlyString(0777)) 12 thisFileRw := chmodhelper.New.SimpleFileReaderWriter.DefaultCleanPath("cmd/main/main.go") 13 14 fmt.Println(thisFileRw) 15 jsonResult := thisFileRw.Json() 16 17 fmt.Println(jsonResult.JsonString()) 18 anotherRw := chmodhelper.New.SimpleFileReaderWriter.Path( 19 0111, 0111, 20 "dwdddw") 21 err := anotherRw.JsonParseSelfInject(jsonResult.Ptr()) 22 errcore.HandleErr(err) 23 fmt.Println("unmarshalled", anotherRw.JsonPtr().JsonString()) 24 25 fmt.Println(thisFileRw.JsonPtr().JsonString()) 26 fmt.Println(thisFileRw.ReadStringMust()) 27 }