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
+10
View File
@@ -1,5 +1,15 @@
package internal
import "strconv"
// AppendStrDecimal appends pfx followed by value in base 10 to dst and returns
// the resulting slice. It condenses the prefixed-number pattern common to
// AppendString/AppendText methods, i.e. `internal.AppendStrDecimal(b, " len=", 4)`.
func AppendStrDecimal(dst []byte, pfx string, value int64) []byte {
dst = append(dst, pfx...)
return strconv.AppendInt(dst, value, 10)
}
// IntLen returns the number of bytes [strconv.AppendInt] emits for value in the
// given base, including a leading minus sign for negatives. Lets callers size a
// buffer, or test whether a value fits an existing slot, before writing a byte.