Skip to content

Why the app panic? #78

Description

@netjune
package main

import (
	"fmt"
	js "github.com/bitly/go-simplejson"
)

func main() {
	child := js.New()
	child.Set("foo", "foo")
	child.Set("bar", "bar")

	parent := js.New()
	parent.Set("child_1", child)

	tmp_json := parent.Get("child_1")

	ss, _ := tmp_json.EncodePretty()
	fmt.Printf("==== ss: %s\n", ss)

	s1,err := tmp_json.Get("foo").String()
	if err != nil {
		panic(0)
	}
	fmt.Printf("=== s1: %s\n", s1)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions