MCPcopy Create free account
hub / github.com/coder/slog / New

Function New

internal/syncwriter/syncwriter.go:22–32  ·  view source on GitHub ↗

New returns a new Writer that writes to w.

(w io.Writer)

Source from the content-addressed store, hash-verified

20
21// New returns a new Writer that writes to w.
22func New(w io.Writer) *Writer {
23 return &Writer{
24 w: w,
25
26 errorf: func(f string, v ...interface{}) {
27 // Avoid the builtin println, which writes to fd 2
28 // unsynchronized and can corrupt concurrent go test output.
29 fmt.Fprintf(os.Stderr, f+"\n", v...)
30 },
31 }
32}
33
34func (w *Writer) Write(name string, p []byte) {
35 w.mu.Lock()

Callers 5

SinkFunction · 0.92
SinkFunction · 0.92
SinkFunction · 0.92
TestWriter_SyncFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestWriter_SyncFunction · 0.68