cull fmt package use and prevent aggressive DCE in MWE example with TinyGo

This commit is contained in:
soypat
2026-09-01 09:39:10 -07:00
parent d219daa2c4
commit c97a32f3c1
14 changed files with 197 additions and 97 deletions
+7 -2
View File
@@ -2,10 +2,10 @@ package tcp
import (
"encoding/binary"
"fmt"
"math"
"github.com/soypat/lneto"
"github.com/soypat/lneto/internal"
)
const (
@@ -170,7 +170,12 @@ func (tfrm Frame) String() string {
src := tfrm.SourcePort()
dst := tfrm.DestinationPort()
seg := tfrm.Segment(len(tfrm.Payload()))
return fmt.Sprintf("TCP :%d -> :%d %s", src, dst, seg.String())
b := make([]byte, 0, 64)
b = append(b, "TCP "...)
b = internal.AppendStrDecimal(b, " src=", int64(src))
b = internal.AppendStrDecimal(b, " dst=", int64(dst))
b = append(b, ' ')
return string(seg.AppendString(b))
}
//