You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
starainrt/ini_test.go

24 lines
421 B
Go

package starainrt
import (
"fmt"
"testing"
)
func Test_CfgParse(t *testing.T) {
data := `#lalala
ok =true\# #ok
[happy] #ok
#kkk
me = \=tru
sa = p\\k
migrate = ok #oooo
[siki]
sakurs = ssss #[ossk]`
//data, _ := ioutil.ReadFile(`c:\Users\Starainrt\Desktop\postgresql.conf`)
ini := new(StarCfg)
ini.ParseINI([]byte(data))
ini.Seg("happy").SetInt64("sakura", 986787,"")
fmt.Println(string(ini.Build()))
}