Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Gophercraft Text Format

Joshua Achorn edited this page Jun 30, 2020 · 3 revisions

Due to the special needs of the software (and the failure of JSON and YAML to meet them), I created a custom data interchange format for Gophercraft.

To keep the format simple and sane, it cannot deal with arbitrary data: data is parsed according to a known schema.

Example document

type Document struct {
  StringField string
  IntegerSlice []int
  Embedded    struct {
    Value float32
  }
}
{
  // Comments are allowed. C-style block comments are not yet implemented, but they may be in the future.
  StringField QuotesUnnecessary

  // Keys and values are both words. All words may be quoted.
  "IntegerSlice"
  {
    1
    2
    3
    "4" // Not a string, but can be quoted.
  }

  // Brackets are not always necessary to set a value in a struct.
  Embedded.Value 123.456
}
Clone this wiki locally