mustWriteForHash serializes the object c to the writer w, from which presumably a hash can be extracted. This function may panic with an error from the underlying writer, and may produce errors of its own if passed objects whose hash-serialization formats are not specified. It MUST NOT produce erro
(w io.Writer, c interface{})
| 72 | // hash-serialization formats are not specified. It MUST NOT produce |
| 73 | // errors in other cases. |
| 74 | func mustWriteForHash(w io.Writer, c interface{}) { |
| 75 | err := writeForHash(w, c) |
| 76 | if err != nil { |
| 77 | panic(err) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | func writeForHash(w io.Writer, c interface{}) error { |
| 82 | switch v := c.(type) { |
no test coverage detected