From b6dfbbd6bc70efae82c122836fd257f065ab2f79 Mon Sep 17 00:00:00 2001 From: Tao Wen Date: Sun, 18 Jun 2017 23:42:23 +0800 Subject: [PATCH] add document --- README.md | 2 ++ example_test.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index b7dcd44..258f237 100644 --- a/README.md +++ b/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 ``` diff --git a/example_test.go b/example_test.go index aae662a..1d38645 100644 --- a/example_test.go +++ b/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 +} \ No newline at end of file