MCPcopy Index your code
hub / github.com/dunglas/httpsfv / ExampleUnmarshalList

Function ExampleUnmarshalList

example_test.go:10–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8)
9
10func 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
26func ExampleMarshal() {
27 p := List{NewItem("/member/*/author"), NewItem("/member/*/comments")}

Callers

nothing calls this directly

Calls 2

UnmarshalListFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…