Is it possible to avoid printing the go file name in the go test output?
For example, I have this print out:
=== RUN TestValidateFreezeErrors_MarshalJSON
validate_freeze_test.go:125: Given freeze validate errors
validate_freeze_test.go:127: Test 0: only inventory parse errors
utils.go:16: ✅ Should return no error
utils.go:16: ✅ Should return the expected JSON
validate_freeze_test.go:127: Test 1: only cross-check errors
utils.go:16: ✅ Should return no error
utils.go:16: ✅ Should return the expected JSON
validate_freeze_test.go:127: Test 2: both error types
utils.go:16: ✅ Should return no error
utils.go:16: ✅ Should return the expected JSON
--- PASS: TestValidateFreezeErrors_MarshalJSON (0.00s)
I would like to print it like so:
=== RUN TestValidateFreezeErrors_MarshalJSON
Given freeze validate errors
Test 0: only inventory parse errors
✅ Should return no error
✅ Should return the expected JSON
Test 1: only cross-check errors
✅ Should return no error
✅ Should return the expected JSON
Test 2: both error types
✅ Should return no error
✅ Should return the expected JSON
--- PASS: TestValidateFreezeErrors_MarshalJSON (0.00s)
I tried looking at go help test
and go help testflag
but I can’t seem to find any options for it. So maybe there’s a way to programmatically turn it off.