cuelang.org/go@v0.10.1/encoding/protobuf/textproto/testdata/decoder/simple.txtar (about)

     1  // From: https://stackoverflow.com/questions/18873924/what-does-the-protobuf-text-format-look-like
     2  -- foo.cue --
     3  #MyEnum: "Default" | "Variant1" | "Variant100"
     4  
     5  f1: string
     6  f2: int64
     7  fa: [...uint64]
     8  fb: [...int32]
     9  fc: [...number]
    10  pairs: [...#Pair]
    11  bbbb: bytes // optional
    12  
    13  //    extensions 100 to max;
    14  
    15  #Pair: {
    16  	key:   string
    17  	value: string
    18  }
    19  -- input.textproto --
    20  f1: "dsfadsafsaf"
    21  f2: 234 # value comment
    22  
    23  fa: 2342134
    24  fa: 2342135
    25  fa: 2342136
    26  # Mix of list and single elements.
    27  fb: [ -2342134, -2342135, -2342136 ]
    28  fb: -1000
    29  
    30  fc: 4
    31  fc: 7
    32  fc: -12
    33  fc: 4
    34  fc: 7
    35  fc: -3
    36  fc: 4
    37  fc: 7
    38  fc: 0
    39  pairs {
    40      key: "sdfff"
    41      value: "q\"qq\\q\n"
    42  }
    43  pairs {
    44      key: "   sdfff2  \321\202\320\265\321\201\321\202 "
    45      value: "q\tqq<>q2&\001\377"
    46  }
    47  bbbb: "\000\001\002\377\376\375"
    48  -- out/decode --
    49  f1: "dsfadsafsaf"
    50  f2: 234 // value comment
    51  fa: [2342134, 2342135, 2342136]
    52  // Mix of list and single elements.
    53  fb: [-2342134, -2342135, -2342136, -1000]
    54  fc: [4, 7, -12, 4, 7, -3, 4, 7, 0]
    55  pairs: [{
    56  	key:   "sdfff"
    57  	value: "q\"qq\\q\n"
    58  }, {
    59  	key:   "   sdfff2  тест "
    60  	value: "q\tqq<>q2&\u0001�"
    61  }]
    62  bbbb: '\x00\x01\x02\xff\xfe\xfd'