kamilib

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stdout io.Writer = os.Stdout

Stdout 是编译产物的默认输出目标,方便测试时替换。

Functions

func AppendAny

func AppendAny(b []byte, v any) []byte

AppendAny 将任意值以文本形式追加到 b,已知类型走 strconv 避免反射。 未知类型回退到 fmt.Sprint。

func AppendPrint

func AppendPrint(b []byte, v any) []byte

AppendPrint 将 v 的文本表示追加到 b 并追加换行。

func KamiPrint

func KamiPrint(v any) error

KamiPrint 将 v 的文本表示写入 Stdout 并追加换行。 用于编译产物中 print 关键字的运行时实现。

func WaitTimeout

func WaitTimeout(wg *sync.WaitGroup, secs int64) error

WaitTimeout waits for a sync.WaitGroup to finish with a timeout. Returns nil if the WaitGroup completes before the timeout, or an error if the timeout is reached.

func WritePrint

func WritePrint(w io.Writer, s string) (int, error)

WritePrint 将 s 写入 w 并追加换行,使用 buf 池避免分配。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL