go test

built-in
0.0% Savings
0 Commands
0 Tokens saved
3 Tests

Install

tokf install 978d41fe64c2afec8ece824baf48c83a4204b694d6bf02c738378ff21490d6e0
Safety checks passed

Filter definition

command = "go test"
description = "Strip per-test RUN/PASS noise; show failures and summary"
skip = ["^=== RUN ", "^=== PAUSE ", "^=== CONT ", "--- PASS:", "^PASS$", "^\\?\\s+"]

[on_success]
output = "✓ go test\n{output}"

[on_failure]
skip = ["^ok\\s+"]

[fallback]
tail = 20

Examples

all passing tests collapse to summary lines ~302 tokens → ~18 tokens (94% saved)
Raw output
=== RUN   TestAdd
--- PASS: TestAdd (0.00s)
=== RUN   TestSubtract
--- PASS: TestSubtract (0.00s)
=== RUN   TestMultiply
--- PASS: TestMultiply (0.00s)
=== RUN   TestDivide
--- PASS: TestDivide (0.00s)
=== RUN   TestDivideByZero
--- PASS: TestDivideByZero (0.00s)
=== RUN   TestSquareRoot
=== RUN   TestSquareRoot/positive
=== RUN   TestSquareRoot/zero
=== RUN   TestSquareRoot/negative_returns_error
    --- PASS: TestSquareRoot/positive (0.00s)
    --- PASS: TestSquareRoot/zero (0.00s)
    --- PASS: TestSquareRoot/negative_returns_error (0.00s)
--- PASS: TestSquareRoot (0.00s)
=== RUN   TestParallel
=== PAUSE TestParallel
=== CONT  TestParallel
--- PASS: TestParallel (0.00s)
PASS
ok  	example.com/math	0.005s
=== RUN   TestTrimPrefix
--- PASS: TestTrimPrefix (0.00s)
=== RUN   TestTrimSuffix
--- PASS: TestTrimSuffix (0.00s)
=== RUN   TestContains
--- PASS: TestContains (0.00s)
=== RUN   TestReverse
=== RUN   TestReverse/ascii
=== RUN   TestReverse/unicode
    --- PASS: TestReverse/ascii (0.00s)
    --- PASS: TestReverse/unicode (0.00s)
--- PASS: TestReverse (0.00s)
=== RUN   TestJoin
--- PASS: TestJoin (0.00s)
=== RUN   TestSplit
--- PASS: TestSplit (0.00s)
PASS
ok  	example.com/strutil	0.003s
Filtered output
✓ go test
ok  	example.com/math	0.005s
ok  	example.com/strutil	0.003s
test failures show error details and FAIL lines ~176 tokens → ~64 tokens (64% saved)
Raw output
=== RUN   TestAdd
--- PASS: TestAdd (0.00s)
=== RUN   TestSubtract
--- PASS: TestSubtract (0.00s)
=== RUN   TestMultiply
    math_test.go:25: expected 12, got 0
--- FAIL: TestMultiply (0.00s)
=== RUN   TestDivide
--- PASS: TestDivide (0.00s)
=== RUN   TestDivideByZero
=== RUN   TestDivideByZero/returns_error
    math_test.go:44: expected error for zero divisor, got nil
    --- FAIL: TestDivideByZero/returns_error (0.00s)
--- FAIL: TestDivideByZero (0.00s)
FAIL
FAIL	example.com/math	0.004s
=== RUN   TestTrimPrefix
--- PASS: TestTrimPrefix (0.00s)
=== RUN   TestTrimSuffix
--- PASS: TestTrimSuffix (0.00s)
=== RUN   TestContains
--- PASS: TestContains (0.00s)
PASS
ok  	example.com/strutil	0.002s
FAIL
Filtered output
    math_test.go:25: expected 12, got 0
--- FAIL: TestMultiply (0.00s)
    math_test.go:44: expected error for zero divisor, got nil
    --- FAIL: TestDivideByZero/returns_error (0.00s)
--- FAIL: TestDivideByZero (0.00s)
FAIL
FAIL	example.com/math	0.004s
FAIL
panic preserves stack trace and FAIL line ~211 tokens → ~205 tokens (3% saved)
Raw output
=== RUN   TestBadAccess
--- FAIL: TestBadAccess (0.00s)
panic: runtime error: index out of range [5] with length 3 [recovered]
	panic: runtime error: index out of range [5] with length 3

goroutine 7 [running]:
testing.tRunner.func1.2({0x104b8a0e0, 0x104ba4480})
	/usr/local/go/src/testing/testing.go:1632 +0x230
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1635 +0x334
panic({0x104b8a0e0?, 0x104ba4480?})
	/usr/local/go/src/runtime/panic.go:785 +0x124
example.com/myapp.GetItem(...)
	/Users/dev/myapp/store.go:42 +0x1c
example.com/myapp.TestBadAccess(0x14000003e00)
	/Users/dev/myapp/store_test.go:15 +0x30
testing.tRunner(0x14000003e00, 0x104b9c7a8)
	/usr/local/go/src/testing/testing.go:1690 +0x108
created by testing.(*T).Run in goroutine 1
	/usr/local/go/src/testing/testing.go:1743 +0x318
FAIL	example.com/myapp	0.006s
FAIL
Filtered output
--- FAIL: TestBadAccess (0.00s)
panic: runtime error: index out of range [5] with length 3 [recovered]
	panic: runtime error: index out of range [5] with length 3

goroutine 7 [running]:
testing.tRunner.func1.2({0x104b8a0e0, 0x104ba4480})
	/usr/local/go/src/testing/testing.go:1632 +0x230
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1635 +0x334
panic({0x104b8a0e0?, 0x104ba4480?})
	/usr/local/go/src/runtime/panic.go:785 +0x124
example.com/myapp.GetItem(...)
	/Users/dev/myapp/store.go:42 +0x1c
example.com/myapp.TestBadAccess(0x14000003e00)
	/Users/dev/myapp/store_test.go:15 +0x30
testing.tRunner(0x14000003e00, 0x104b9c7a8)
	/usr/local/go/src/testing/testing.go:1690 +0x108
created by testing.(*T).Run in goroutine 1
	/usr/local/go/src/testing/testing.go:1743 +0x318
FAIL	example.com/myapp	0.006s
FAIL
Warning: Community filters are third-party code. Review the filter definition above before installing it in production environments.
Browse all filters