update host file

This commit is contained in:
2024-04-10 15:19:25 +08:00
parent bae1b83843
commit a1fdeb62fc
3 changed files with 745 additions and 88 deletions
+6 -7
View File
@@ -33,11 +33,10 @@ func Test_Parse(t *testing.T) {
fmt.Println(cfg.Parse([]byte(data)))
cfg.Reverse()
cfg.Data[0].Delete(`pp.com`)
//fmt.Println(cfg.Data[0].Comment)
//fmt.Println(cfg.Data[0].comment)
fmt.Println(string(cfg.Build()))
}
type slicetest struct {
A string `seg:"s" key:"a"`
B string `seg:"a" key:"b"`
@@ -50,7 +49,7 @@ type testme struct {
func Test_Marshal(t *testing.T) {
var info string =`
var info string = `
[love]
a=abc
b=123
@@ -59,10 +58,10 @@ a=456
b=789
`
var tmp testme
ini:=NewIni()
ini := NewIni()
ini.Parse([]byte(info))
ini.Unmarshal(&tmp)
fmt.Printf("%+v\n",tmp)
b,_:=ini.Marshal(tmp)
fmt.Printf("%+v\n", tmp)
b, _ := ini.Marshal(tmp)
fmt.Println(string(b))
}
}