json

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

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

Encode converts a CUE AST to unescaped JSON.

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

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

Comments and attributes are ignored.

func Marshal added in v0.6.0

func Marshal(v any) ([]byte, error)

Marshal is a replacement for json.Marshal without HTML escaping.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL