MCPcopy
hub / github.com/elastic/go-elasticsearch / EncodeJSON

Method EncodeJSON

esutil/json_reader_internal_test.go:35–41  ·  view source on GitHub ↗
(w io.Writer)

Source from the content-addressed store, hash-verified

33}
34
35func (f Foo) EncodeJSON(w io.Writer) error {
36 _, err := w.Write([]byte(`{"bar":"` + strings.ToUpper(f.Bar) + `"}` + "\n"))
37 if err != nil {
38 return err
39 }
40 return nil
41}
42
43// errEncoder is a JSONEncoder that always returns an error, used to test
44// encode-error paths.

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected