(w io.Writer, v interface{})
| 238 | } |
| 239 | |
| 240 | func encodeStdlib(w io.Writer, v interface{}) error { |
| 241 | // Doesn't stream the output because that adds a newline, as per: |
| 242 | // https://golang.org/pkg/encoding/json/#Encoder.Encode |
| 243 | blob, err := json.Marshal(v) |
| 244 | if err != nil { |
| 245 | return err |
| 246 | } |
| 247 | _, err = w.Write(blob) |
| 248 | return err |
| 249 | } |
| 250 | |
| 251 | func writeStr(w io.Writer, s string) error { |
| 252 | _, err := w.Write([]byte(s)) |
no test coverage detected