cuelang.org/go@v0.10.1/tools/trim/testdata/optional.txtar (about)

     1  // Optional fields should retain status after removal of unified
     2  // content.
     3  
     4  // Issue #855
     5  
     6  -- cue.mod/module.cue --
     7  module: "mod.test"
     8  language: version: "v0.9.0"
     9  -- a.cue --
    10  package pkg
    11  
    12  a: [...#A]
    13  
    14  a: [{
    15  	annotations: {}
    16  }]
    17  
    18  #A: annotations?: [string]: string
    19  
    20  b: #B
    21  b: bb: c:   2 // c can be removed, bb not.
    22  #B: bb?: c: 2
    23  -- out/trim --
    24  == a.cue
    25  package pkg
    26  
    27  a: [...#A]
    28  
    29  a: [{
    30  	annotations: {}
    31  }]
    32  
    33  #A: annotations?: [string]: string
    34  
    35  b:        #B
    36  b: bb: {} // c can be removed, bb not.
    37  #B: bb?: c: 2