// CreateNode creates a node by marshalling an interface to json,
// and then unmarshalling into a struct.  Useful in the javascript builder
// to persist nodes in the js environment
CreateNode creates a node by marshalling an interface to json,
and then unmarshalling into a struct.  Useful in the javascript builder
to persist nodes in the js environment
// CreateNode creates a node by marshalling an interface to json // and then unmarshalling into a struct . Useful in the javascript builder // to persist nodes in the js environment
func CreateNode(val interface{}) (Node, error) {
	t := Node{}
	ba, err := json.Marshal(val)
	if err != nil {
		return t, err
	}
	err = json.Unmarshal(ba, &t)
	return t, err
}
func CreateNode ( val interface { } ) ( Node , error ) { t := Node { } ba , err := json . Marshal ( val ) if err != nil { return t , err } err = json . Unmarshal ( ba , & t ) return t , err }
CreateNode creates a node by marshalling an interface to json,
and then unmarshalling into a struct.
CreateNode creates a node by marshalling an interface to json and then unmarshalling into a struct .