MCPcopy Create free account
hub / github.com/gobwas/httphead / ExampleWriteOptions

Function ExampleWriteOptions

writer_test.go:10–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8)
9
10func ExampleWriteOptions() {
11 opts := []Option{
12 NewOption("foo", map[string]string{
13 "param": "hello, world!",
14 }),
15 NewOption("bar", nil),
16 NewOption("b a z", nil),
17 }
18
19 buf := bytes.Buffer{}
20 bw := bufio.NewWriter(&buf)
21
22 WriteOptions(bw, opts)
23 bw.Flush()
24
25 // Output: foo;param="hello, world!",bar,"b a z"
26 fmt.Println(buf.String())
27}
28
29func TestWriteOptions(t *testing.T) {
30 for _, test := range []struct {

Callers

nothing calls this directly

Calls 3

NewOptionFunction · 0.85
WriteOptionsFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…