package main
import (
"fmt"
"github.com/JoaoHickmann/go-jsonhelper/jsonhelper"
)
func main() {
json := `
{
"string": "string",
"number": 2.5,
"bool": true,
"array": [
1,
2,
3
],
"object": {
"key": "value"
}
}
`
jsonHelper, err := jsonhelper.NewJSONHelper([]byte(json))
if err != nil {
panic(err)
}
fmt.Println(jsonHelper.Map()["string"].String())
fmt.Println(jsonHelper.Map()["number"].Number())
fmt.Println(jsonHelper.Map()["bool"].Bool())
fmt.Println(jsonHelper.Map()["array"].Array()[0].Number())
fmt.Println(jsonHelper.Map()["object"].Map()["key"].String())
}
-
Notifications
You must be signed in to change notification settings - Fork 0
License
joaophi/go-jsonhelper
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published