cuelang.org/go@v0.13.0/tools/trim/testdata/48.txtar (about)

     1  Variant of 47 where the comprehension makes use of the value of the
     2  key-value pair.
     3  
     4  #skip-v2
     5  -- a.cue --
     6  d: port: 8080
     7  s: {
     8  	x: {
     9  		port: 8080
    10  	}
    11  	y: {
    12  		port: 8080
    13  	}
    14  }
    15  for k, v in s {
    16  	s: (k): d
    17  	s: (k): portCopy: v.port
    18  }
    19  -- out/trim-v3 --
    20  == a.cue
    21  d: port: 8080
    22  s: {
    23  	x: _
    24  	y: _
    25  }
    26  for k, v in s {
    27  	s: (k): d
    28  	s: (k): portCopy: v.port
    29  }
    30  -- out/trim-v3-noshare --
    31  == a.cue
    32  d: port: 8080
    33  s: {
    34  	x: _
    35  	y: _
    36  }
    37  for k, v in s {
    38  	s: (k): d
    39  	s: (k): portCopy: v.port
    40  }