(bufs ...[]byte)
| 2178 | } |
| 2179 | |
| 2180 | func (w *natsWriter) appendBufs(bufs ...[]byte) error { |
| 2181 | for _, buf := range bufs { |
| 2182 | if len(buf) == 0 { |
| 2183 | continue |
| 2184 | } |
| 2185 | if w.pending != nil { |
| 2186 | w.pending.Write(buf) |
| 2187 | } else { |
| 2188 | w.bufs = append(w.bufs, buf...) |
| 2189 | } |
| 2190 | } |
| 2191 | if w.pending == nil && len(w.bufs) >= w.limit { |
| 2192 | return w.flush() |
| 2193 | } |
| 2194 | return nil |
| 2195 | } |
| 2196 | |
| 2197 | func (w *natsWriter) writeDirect(strs ...string) error { |
| 2198 | for _, str := range strs { |
no test coverage detected