소스 검색

add document

Tao Wen 8 년 전
부모
커밋
b6dfbbd6bc
2개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      README.md
  2. 7 0
      example_test.go

+ 2 - 0
README.md

@@ -51,6 +51,8 @@ import "github.com/json-iterator/go"
 jsoniter.Unmarshal(input, &data)
 ```
 
+[More documentation](http://jsoniter.com/migrate-from-go-std.html)
+
 # How to get
 
 ```

+ 7 - 0
example_test.go

@@ -88,3 +88,10 @@ func ExampleUnmarshalWithBestPerformance() {
 	// Output:
 	// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
 }
+
+func ExampleOneLine() {
+	val := []byte(`{"ID":1,"Name":"Reds","Colors":["Crimson","Red","Ruby","Maroon"]}`)
+	fmt.Printf(jsoniter.Get(val, "Colors", 0).ToString())
+	// Output:
+	// Crimson
+}