()
| 73 | } |
| 74 | |
| 75 | func ExampleValues() { |
| 76 | doc := ` |
| 77 | title: "Moby Dick" |
| 78 | chapter: |
| 79 | one: |
| 80 | title: "Loomings" |
| 81 | two: |
| 82 | title: "The Carpet-Bag" |
| 83 | three: |
| 84 | title: "The Spouter Inn" |
| 85 | ` |
| 86 | d, err := ReadValues([]byte(doc)) |
| 87 | if err != nil { |
| 88 | panic(err) |
| 89 | } |
| 90 | ch1, err := d.Table("chapter.one") |
| 91 | if err != nil { |
| 92 | panic("could not find chapter one") |
| 93 | } |
| 94 | fmt.Print(ch1["title"]) |
| 95 | // Output: |
| 96 | // Loomings |
| 97 | } |
| 98 | |
| 99 | func TestTable(t *testing.T) { |
| 100 | doc := ` |
nothing calls this directly
no test coverage detected
searching dependent graphs…