(s string)
| 156 | } |
| 157 | |
| 158 | func (cw *countWriter) writeString(s string) { |
| 159 | if cw.err != nil { |
| 160 | return |
| 161 | } |
| 162 | if len(s) == 1 { |
| 163 | cw.writeByte(s[0]) |
| 164 | return |
| 165 | } |
| 166 | if sw, ok := cw.w.(io.StringWriter); ok { |
| 167 | n, err := sw.WriteString(s) |
| 168 | cw.n += int64(n) |
| 169 | cw.err = err |
| 170 | return |
| 171 | } |
| 172 | cw.buf = cw.buf[:0] |
| 173 | cw.buf = append(cw.buf, s...) |
| 174 | cw.writeBytes(cw.buf) |
| 175 | } |
| 176 | |
| 177 | func (cw *countWriter) writeInt(x int) { |
| 178 | if cw.err != nil { |
no test coverage detected