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.Parse([]byte(data)) ini.Seg("happy").SetInt64("sakura", 986787, "") fmt.Println(string(ini.Build())) }