Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morinokami/gj
A simple JSON parser.
https://github.com/morinokami/gj
Last synced: about 1 month ago
JSON representation
A simple JSON parser.
- Host: GitHub
- URL: https://github.com/morinokami/gj
- Owner: morinokami
- Created: 2020-04-24T14:26:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T10:33:33.000Z (over 4 years ago)
- Last Synced: 2024-03-17T21:53:53.135Z (10 months ago)
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gj
gj is a simple JSON parser written in Go.## Usage
```go
import "github.com/morinokami/gj"input := `{
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 27,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
},
"phoneNumbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
}
],
"children": [],
"spouse": null
}`json, err := gj.ParseString(input)
city, err := json.Get("address.city")
number, err := json.Get("phoneNumbers.[1].number")
```