6

I am trying to write a configuration file that would be an array (list) or dictionaries (hashes, tables). In JSON terms that would be for instance

[
   {
      "a":1,
      "b":2
   },
   {
      "a":10,
      "b":20
   }
]

I was hoping that

[[]]
a = 1
b = 2

[[]]
a = 10
b = 20

would be correct, but it is rejected by my Go parser with

 unexpected token "]]", was expecting a table array key

This suggests that only top-level dictionaries (hashes, tables) are allowed. Is that really the case?

WoJ
  • 27,165
  • 48
  • 180
  • 345

0 Answers0