go: cuelang.org/go/internal/encoding/json Index | Files

package json

import "cuelang.org/go/internal/encoding/json"


Package Files


func Encode Uses

func Encode(n ast.Node) (b []byte, err error)

Encode converts a CUE AST to JSON.

The given file must only contain values that can be directly supported by JSON:

Type          Restrictions
File          no imports, aliases, or definitions
StructLit     no embeddings, aliases, or definitions
Field         must be regular; label must be a BasicLit or Ident

Comments and attributes are ignored.

Package json imports 9 packages (graph) and is imported by 2 packages. Updated 2021-01-26. Refresh now. Tools for package owners.