We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import ( "fmt" "code.cloudfoundry.org/jsonry" ) func main() { data := `{"nfs":[{"volume_mounts":[{"container_dir":"foo"}]}]}` var receiver struct { Paths []string `jsonry:"nfs.volume_mounts.container_dir"` } if err := jsonry.Unmarshal([]byte(data), &receiver); err != nil { panic(err) } fmt.Printf("%+v", receiver.Paths) }
You'd expect this to extract the string foo, but it panics with:
foo
panic: cannot unmarshal "[foo]" type "[]interface {}" into index 0 (type "string") path Paths[0]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
You'd expect this to extract the string
foo
, but it panics with:The text was updated successfully, but these errors were encountered: