MCPcopy
hub / github.com/uber-go/zap / Write

Method Write

zaptest/logger.go:139–152  ·  view source on GitHub ↗

Write writes bytes from p to the underlying testing.TB.

(p []byte)

Source from the content-addressed store, hash-verified

137
138// Write writes bytes from p to the underlying testing.TB.
139func (w TestingWriter) Write(p []byte) (n int, err error) {
140 n = len(p)
141
142 // Strip trailing newline because t.Log always adds one.
143 p = bytes.TrimRight(p, "\n")
144
145 // Note: t.Log is safe for concurrent use.
146 w.t.Logf("%s", p)
147 if w.markFailed {
148 w.t.Fail()
149 }
150
151 return n, nil
152}
153
154// Sync commits the current contents (a no-op for TestingWriter).
155func (w TestingWriter) Sync() error {

Callers

nothing calls this directly

Calls 2

LogfMethod · 0.65
FailMethod · 0.65

Tested by

no test coverage detected