example names change

This commit is contained in:
John
2020-03-22 12:49:46 +08:00
parent a5e048eb5f
commit 75dc1d82c1
9 changed files with 25 additions and 25 deletions

View File

@ -11,7 +11,7 @@ import (
"github.com/gogf/gf/encoding/gjson"
)
func Example_ConversionNormalFormats() {
func Example_conversionNormalFormats() {
data :=
`{
"users" : {
@ -59,7 +59,7 @@ func Example_ConversionNormalFormats() {
// count = 1.0
}
func Example_ConversionGetStruct() {
func Example_conversionGetStruct() {
data :=
`{
"users" : {
@ -85,7 +85,7 @@ func Example_ConversionGetStruct() {
// &{Count:1 Array:[John Ming]}
}
func Example_ConversionToStruct() {
func Example_conversionToStruct() {
data :=
`
{

View File

@ -11,7 +11,7 @@ import (
"github.com/gogf/gf/encoding/gjson"
)
func Example_DataSetCreate1() {
func Example_dataSetCreate1() {
j := gjson.New(nil)
j.Set("name", "John")
j.Set("score", 99.5)
@ -27,7 +27,7 @@ func Example_DataSetCreate1() {
// {"name":"John","score":99.5}
}
func Example_DataSetCreate2() {
func Example_dataSetCreate2() {
j := gjson.New(nil)
for i := 0; i < 5; i++ {
j.Set(fmt.Sprintf(`%d.id`, i), i)
@ -39,7 +39,7 @@ func Example_DataSetCreate2() {
// [{"id":0,"name":"student-0"},{"id":1,"name":"student-1"},{"id":2,"name":"student-2"},{"id":3,"name":"student-3"},{"id":4,"name":"student-4"}]
}
func Example_DataSetRuntimeEdit() {
func Example_dataSetRuntimeEdit() {
data :=
`{
"users" : {

View File

@ -12,21 +12,21 @@ import (
"github.com/gogf/gf/encoding/gjson"
)
func Example_LoadJson() {
func Example_loadJson() {
jsonFilePath := gdebug.TestDataPath("json", "data1.json")
j, _ := gjson.Load(jsonFilePath)
fmt.Println(j.Get("name"))
fmt.Println(j.Get("score"))
}
func Example_LoadXml() {
func Example_loadXml() {
jsonFilePath := gdebug.TestDataPath("xml", "data1.xml")
j, _ := gjson.Load(jsonFilePath)
fmt.Println(j.Get("doc.name"))
fmt.Println(j.Get("doc.score"))
}
func Example_LoadContent() {
func Example_loadContent() {
jsonContent := `{"name":"john", "score":"100"}`
j, _ := gjson.LoadContent(jsonContent)
fmt.Println(j.Get("name"))

View File

@ -11,7 +11,7 @@ import (
"github.com/gogf/gf/encoding/gjson"
)
func Example_NewFromJson() {
func Example_newFromJson() {
jsonContent := `{"name":"john", "score":"100"}`
j := gjson.New(jsonContent)
fmt.Println(j.Get("name"))
@ -21,7 +21,7 @@ func Example_NewFromJson() {
// 100
}
func Example_NewFromXml() {
func Example_newFromXml() {
jsonContent := `<?xml version="1.0" encoding="UTF-8"?><doc><name>john</name><score>100</score></doc>`
j := gjson.New(jsonContent)
// Note that there's root node in the XML content.
@ -32,7 +32,7 @@ func Example_NewFromXml() {
// 100
}
func Example_NewFromStruct() {
func Example_newFromStruct() {
type Me struct {
Name string `json:"name"`
Score int `json:"score"`
@ -49,7 +49,7 @@ func Example_NewFromStruct() {
// 100
}
func Example_NewFromStructWithTag() {
func Example_newFromStructWithTag() {
type Me struct {
Name string `tag:"name"`
Score int `tag:"score"`

View File

@ -11,7 +11,7 @@ import (
"github.com/gogf/gf/encoding/gjson"
)
func Example_PatternGet() {
func Example_patternGet() {
data :=
`{
"users" : {
@ -31,7 +31,7 @@ func Example_PatternGet() {
// John Score: 99.5
}
func Example_PatternCustomSplitChar() {
func Example_patternCustomSplitChar() {
data :=
`{
"users" : {
@ -52,7 +52,7 @@ func Example_PatternCustomSplitChar() {
// John Score: 99.5
}
func Example_PatternViolenceCheck() {
func Example_patternViolenceCheck() {
data :=
`{
"users" : {