...

Text file src/cuelang.org/go/doc/tutorial/basics/4_references/50_emit.txtar

Documentation: cuelang.org/go/doc/tutorial/basics/4_references

     1exec cue export emit.cue
     2cmp stdout expect-stdout-cue
     3
     4-- frontmatter.toml --
     5title = "Emit Values"
     6description = ""
     7
     8-- text.md --
     9By default all top-level fields are emitted when evaluating a configuration.
    10Embedding a value at top-level will cause that value to be emitted instead.
    11
    12Emit values allow CUE configurations, like JSON,
    13to define any type, instead of just structs, while keeping the common case
    14of defining structs light.
    15
    16-- emit.cue --
    17"Hello \(#who)!"
    18
    19#who: "world"
    20
    21-- expect-stdout-cue --
    22"Hello world!"

View as plain text