Skip to content

klauskie/go-json-mcparsey

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-json-mcparsey

go-json-mcparsey is a very forgiving json helper parser for golang, the default one is very strict when parsing to a struct and would rightfully break when the json is not using the exact correct type, this tries as much as possible to parse to the correct type, going out of it's way to accept a json that was not stringfied using the exact type

Installation

go get github.com/TrackStreetPlatform/go-json-mcparsey

Example

func foo(decodedJson map[string]interface{}) {
    productId := Int(decodedJson, "productId", 0)
    name := String(decodedJson, "details > name", "")
    firstImage := String(decodedJson, "details > images[0] > src", "")
    ...
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%