...

Text file src/cuelang.org/go/encoding/protobuf/textproto/testdata/decoder/map.txtar

Documentation: cuelang.org/go/encoding/protobuf/textproto/testdata/decoder

     1-- map.cue --
     2map: {[string]: int} @protobuf(1,map[string]int)
     3
     4implicit: [string]: string
     5
     6intMap: {[string]: int} @protobuf(1,map[int]int)
     7-- input.textproto --
     8map: {
     9    key: "foo"
    10    value: 2
    11}
    12map: {
    13    key: "bar"
    14    value: 3
    15}
    16
    17implicit: {
    18    key: "foo"
    19    value: 2
    20}
    21implicit: {
    22    key: "bar"
    23    value: 3
    24}
    25
    26intMap: {
    27    key:   100
    28    value: 2
    29}
    30intMap: {
    31    key:   102
    32    value: 3
    33}
    34
    35-- out/decode --
    36map: {
    37	"foo": 2
    38}
    39map: {
    40	"bar": 3
    41}
    42implicit: {}
    43implicit: {}
    44intMap: {
    45	"100": 2
    46}
    47intMap: {
    48	"102": 3
    49}

View as plain text