MCPcopy Create free account
hub / github.com/canopyclimate/golive / writeString

Method writeString

internal/tmpl/tree.go:158–175  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

156}
157
158func (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
177func (cw *countWriter) writeInt(x int) {
178 if cw.err != nil {

Callers 1

writeToMethod · 0.80

Calls 2

writeByteMethod · 0.95
writeBytesMethod · 0.95

Tested by

no test coverage detected