test/sandbox/assert: wrap printf
All checks were successful
Test / Create distribution (push) Successful in 26s
Test / Fortify (push) Successful in 2m34s
Test / Data race detector (push) Successful in 3m30s
Test / Fpkg (push) Successful in 3m38s
Test / Flake checks (push) Successful in 50s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-03-02 18:37:46 +09:00
parent d8e9d71f87
commit 0d3652b793
3 changed files with 9 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
package sandbox
func ReplaceFatal(f func(format string, v ...any)) { fatalfFunc = f }
type F func(format string, v ...any)
func SwapPrint(f F) (old F) { old = printfFunc; printfFunc = f; return }
func SwapFatal(f F) (old F) { old = fatalfFunc; fatalfFunc = f; return }