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