Documentation
¶
Overview ¶
Package tj provides shortcuts for constructing JSON without backing it up with Go structures.
Example ¶
package main
import (
"encoding/json"
"fmt"
"github.com/ridge/tj"
)
func main() {
j := tj.O{
"hello": tj.A{
"world",
42,
tj.O{
"go": nil,
},
},
}
bytes, _ := json.MarshalIndent(j, "", " ")
fmt.Printf("%s\n", bytes)
}
Output: { "hello": [ "world", 42, { "go": null } ] }
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.