mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
example name changes
This commit is contained in:
@ -6,7 +6,7 @@ import (
|
||||
"github.com/gogf/gf/container/gmap"
|
||||
)
|
||||
|
||||
func Example_Normal_Basic() {
|
||||
func Example_NormalBasic() {
|
||||
m := gmap.New()
|
||||
|
||||
//Add data
|
||||
@ -61,7 +61,7 @@ func Example_Normal_Basic() {
|
||||
fmt.Println(m.Size())
|
||||
|
||||
}
|
||||
func Example_Normal_Merge() {
|
||||
func Example_NormalMerge() {
|
||||
m1 := gmap.New()
|
||||
m2 := gmap.New()
|
||||
m1.Set("key1", "val1")
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"github.com/gogf/gf/encoding/gjson"
|
||||
)
|
||||
|
||||
func Example_Conversion_NormalFormats() {
|
||||
func Example_ConversionNormalFormats() {
|
||||
data :=
|
||||
`{
|
||||
"users" : {
|
||||
@ -59,7 +59,7 @@ func Example_Conversion_NormalFormats() {
|
||||
// count = 1.0
|
||||
}
|
||||
|
||||
func Example_Conversion_GetStruct() {
|
||||
func Example_ConversionGetStruct() {
|
||||
data :=
|
||||
`{
|
||||
"users" : {
|
||||
@ -85,7 +85,7 @@ func Example_Conversion_GetStruct() {
|
||||
// &{Count:1 Array:[John Ming]}
|
||||
}
|
||||
|
||||
func Example_Conversion_ToStruct() {
|
||||
func Example_ConversionToStruct() {
|
||||
data :=
|
||||
`
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"github.com/gogf/gf/encoding/gjson"
|
||||
)
|
||||
|
||||
func Example_DataSet_Create1() {
|
||||
func Example_DataSetCreate1() {
|
||||
j := gjson.New(nil)
|
||||
j.Set("name", "John")
|
||||
j.Set("score", 99.5)
|
||||
@ -27,7 +27,7 @@ func Example_DataSet_Create1() {
|
||||
// {"name":"John","score":99.5}
|
||||
}
|
||||
|
||||
func Example_DataSet_Create2() {
|
||||
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_DataSet_Create2() {
|
||||
// [{"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_DataSet_RuntimeEdit() {
|
||||
func Example_DataSetRuntimeEdit() {
|
||||
data :=
|
||||
`{
|
||||
"users" : {
|
||||
|
||||
@ -12,21 +12,21 @@ import (
|
||||
"github.com/gogf/gf/encoding/gjson"
|
||||
)
|
||||
|
||||
func Example_Load_Json() {
|
||||
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_Load_Xml() {
|
||||
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_Load_Content() {
|
||||
func Example_LoadContent() {
|
||||
jsonContent := `{"name":"john", "score":"100"}`
|
||||
j, _ := gjson.LoadContent(jsonContent)
|
||||
fmt.Println(j.Get("name"))
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"github.com/gogf/gf/encoding/gjson"
|
||||
)
|
||||
|
||||
func Example_New_FromJson() {
|
||||
func Example_NewFromJson() {
|
||||
jsonContent := `{"name":"john", "score":"100"}`
|
||||
j := gjson.New(jsonContent)
|
||||
fmt.Println(j.Get("name"))
|
||||
@ -21,7 +21,7 @@ func Example_New_FromJson() {
|
||||
// 100
|
||||
}
|
||||
|
||||
func Example_New_FromXml() {
|
||||
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_New_FromXml() {
|
||||
// 100
|
||||
}
|
||||
|
||||
func Example_New_FromStruct() {
|
||||
func Example_NewFromStruct() {
|
||||
type Me struct {
|
||||
Name string `json:"name"`
|
||||
Score int `json:"score"`
|
||||
@ -49,7 +49,7 @@ func Example_New_FromStruct() {
|
||||
// 100
|
||||
}
|
||||
|
||||
func Example_New_FromStructWithTag() {
|
||||
func Example_NewFromStructWithTag() {
|
||||
type Me struct {
|
||||
Name string `tag:"name"`
|
||||
Score int `tag:"score"`
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"github.com/gogf/gf/encoding/gjson"
|
||||
)
|
||||
|
||||
func Example_Pattern_Get() {
|
||||
func Example_PatternGet() {
|
||||
data :=
|
||||
`{
|
||||
"users" : {
|
||||
@ -31,7 +31,7 @@ func Example_Pattern_Get() {
|
||||
// John Score: 99.5
|
||||
}
|
||||
|
||||
func Example_Pattern_CustomSplitChar() {
|
||||
func Example_PatternCustomSplitChar() {
|
||||
data :=
|
||||
`{
|
||||
"users" : {
|
||||
@ -52,7 +52,7 @@ func Example_Pattern_CustomSplitChar() {
|
||||
// John Score: 99.5
|
||||
}
|
||||
|
||||
func Example_Pattern_ViolenceCheck() {
|
||||
func Example_PatternViolenceCheck() {
|
||||
data :=
|
||||
`{
|
||||
"users" : {
|
||||
|
||||
Reference in New Issue
Block a user