MCPcopy
hub / github.com/tinygo-org/tinygo / Write

Method Write

monitor.go:403–424  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

401}
402
403func (w *outputWriter) Write(p []byte) (n int, err error) {
404 start := 0
405 for i, c := range p {
406 if c == '\n' {
407 w.out.Write(p[start : i+1])
408 start = i + 1
409 address := extractPanicAddress(w.line)
410 if address != 0 {
411 loc, err := addressToLine(w.executable, address)
412 if err == nil && loc.Filename != "" {
413 fmt.Printf("[tinygo: panic at %s]\n", loc.String())
414 }
415 }
416 w.line = w.line[:0]
417 } else {
418 w.line = append(w.line, c)
419 }
420 }
421 w.out.Write(p[start:])
422 n = len(p)
423 return
424}

Callers

nothing calls this directly

Calls 4

extractPanicAddressFunction · 0.85
addressToLineFunction · 0.85
WriteMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected