MCPcopy
hub / github.com/betty200744/ultimate-go / Log

Function Log

build-in-package/sync/sync-pool_test.go:26–37  ·  view source on GitHub ↗
(w io.Writer, key, val string)

Source from the content-addressed store, hash-verified

24}
25
26func Log(w io.Writer, key, val string) {
27 b := bufPool.Get().(*bytes.Buffer)
28 b.Reset()
29 // Replace this with time.Now() in a real logger.
30 b.WriteString(timeNow().UTC().Format(time.RFC3339))
31 b.WriteByte(' ')
32 b.WriteString(key)
33 b.WriteByte('=')
34 b.WriteString(val)
35 _, _ = w.Write(b.Bytes())
36 bufPool.Put(b)
37}
38
39func TestPool(t *testing.T) {
40 go Log(os.Stdout, "path", "search1 \n")

Callers 1

TestPoolFunction · 0.85

Calls 5

timeNowFunction · 0.85
GetMethod · 0.65
WriteMethod · 0.65
PutMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected