()
| 8 | ) |
| 9 | |
| 10 | func ExampleUnmarshalList() { |
| 11 | h := http.Header{} |
| 12 | h.Add("Preload", `"/member/*/author", "/member/*/comments"`) |
| 13 | |
| 14 | v, err := UnmarshalList(h["Preload"]) |
| 15 | if err != nil { |
| 16 | log.Fatalln("error: ", err) |
| 17 | } |
| 18 | |
| 19 | fmt.Println("authors selector: ", v[0].(Item).Value) |
| 20 | fmt.Println("comments selector: ", v[1].(Item).Value) |
| 21 | // Output: |
| 22 | // authors selector: /member/*/author |
| 23 | // comments selector: /member/*/comments |
| 24 | } |
| 25 | |
| 26 | func ExampleMarshal() { |
| 27 | p := List{NewItem("/member/*/author"), NewItem("/member/*/comments")} |
nothing calls this directly
no test coverage detected
searching dependent graphs…