JSON

Wikipedia: JSON
Tengo offers built-in support for JSON encoding and decoding.

fmt := import("fmt")
json := import("json")
data := {
    name: "Tengo",
    version: 3,
    tags: ["script", "go", "fast"],
    active: true
}
decoded := json.decode(raw)
fmt.println(decoded)
fmt.println("apple count: ", decoded["apple"])

try it

{"version":3,"tags":["script","go","fast"],"active":true,"name":"Tengo"}
{apple: 5, lettuce: 7}
apple count: 5
loading…