...

Text file src/cuelang.org/go/doc/tutorial/basics/4_references/99_hidden.txtar

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

     1exec cue export hidden.cue
     2cmp stdout expect-stdout-cue
     3
     4-- frontmatter.toml --
     5title = "Hidden Fields"
     6description = ""
     7
     8-- text.md --
     9A non-quoted field name that starts with an underscore (`_`) is not
    10emitted from the output.
    11To include fields in the configuration that start with an underscore
    12put them in quotes.
    13
    14Quoted and non-quoted fields share the same namespace unless they start
    15with an underscore.
    16
    17-- hidden.cue --
    18"_foo": 2
    19_foo:   3
    20foo:    4
    21_#foo:  5
    22
    23-- expect-stdout-cue --
    24{
    25    "_foo": 2,
    26    "foo": 4
    27}

View as plain text