<commit_before>package main

/*
author:DaiJingPei
email:<EMAIL>
url:https://github.com/dijp/json4go
*/

import (
	"fmt"
	"dijp/json4go"
)

type Person struct {
	Name string
	Age  int
	Sex  bool
}

type User struct {
	UserId int
	P      Person
	Map    map[string]int
	Arr    []string
}

func test1() {
	u := User{1, Person{"dog", 30, true}, map[string]int{"a": 1, "b": 2, "c": 3}, []string{"aaa", "bbb", "ccc"}}
	j := json4go.ToJson(u)
	fmt.Println(j.GetJson("P").GetString("Name"))
}

func test2() {
	str := `{"servers":[{"serverName":"Shanghai_VPN","serverIP":"127.0.0.1"},{"serverName":"Beijing_VPN","serverIP":"127.0.0.2"}]}`
	j := json4go.Parse2Json(str)
	fmt.Println(j.GetJsonArray("servers").GetJson(0).GetString("serverName"))
	fmt.Println(j.GetJsonArray("servers").GetJson(1).ToString())
}

func main() {
	test1()<commit_msg>commit Test.go v1.0<commit_after>package main

/*
author:DaiJingPei
email:<EMAIL>
url:https://github.com/dijp/json4go
*/

import (
	"fmt"
	"dijp/json4go"
)

type Person struct {
	Name string
	Age  int
	Sex  bool
}

type User struct {
	UserId int
	P      Person
	Map    map[string]int
	Arr    []string
}

func test1() {
	u := User{1, Person{"dog", 30, true}, map[string]int{"a": 1, "b": 2, "c": 3}, []string{"aaa", "bbb", "ccc"}}
	j := json4go.ToJson(u)
	fmt.Println(j.GetJson("P").GetString("Name"))
}

func test2() {
	str := `{"function":"200","servers":[{"serverName":"Shanghai_VPN","serverIP":"127.0.0.1"},{"serverName":"Beijing_VPN","serverIP":"127.0.0.2"}]}`
	j := json4go.Parse2Json(str)
	fmt.Println(j.GetString("function"))
	fmt.Println(j.GetJsonArray("servers").GetJson(0).GetString("serverName"))
	fmt.Println(j.GetJsonArray("servers").GetJson(1).ToString())
}

func main() {
	test1()
{'fraction_non_alphanumeric': 0.22119281991893458, 'fraction_numerical': 0.03532136653155762, 'mean_word_length': 5.063157894736842, 'pattern_counts': {'":': 17, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4291188', 'n_tokens_mistral': 747, 'n_tokens_neox': 729, 'n_words': 118}