Documentation ¶
Overview ¶
Example ¶
package main import ( "checkup/Godeps/_workspace/src/github.com/mattn/go-scan" "fmt" "strings" ) var js = strings.NewReader(` { "foo": { "bar": [ { "baz": "bbb", "noo": 3 }, { "maz": true, "moo": ["foo", "bar"] } ], "boo": { "bag": "ddd", "bug": "ccc" } } } `) func main() { var s []string if err := scan.ScanJSON(js, "/foo/bar[1]/moo", &s); err != nil { println(err.Error()) } fmt.Println(s[0]) // should be "foo" fmt.Println(s[1]) // should be "bar" }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Scan ¶
func Scan(v interface{}, t interface{}) (err error)
Scan work to scan any type to specified type
Types ¶
Click to show internal directories.
Click to hide internal directories.