File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -731,16 +731,20 @@ func Default() Asserter {
731
731
return defAsserter [def ]
732
732
}
733
733
734
- // SetDefault set the current default asserter for the package. For example, you
735
- // might set it to panic about every assertion fault, and in other cases, throw
736
- // an error, and print the call stack immediately when assert occurs.
734
+ // SetDefault set the current default asserter for assert pkg.
735
+ //
736
+ // Note, that you should use this in TestMain function, and use Flag package to
737
+ // set it for the app. For the tests you can set it to panic about every
738
+ // assertion fault, or to throw an error, or/and print the call stack
739
+ // immediately when assert occurs. The err2 package helps you to catch and
740
+ // report all types of the asserts.
737
741
//
738
742
// Note, that if you are using tracers you might get two call stacks, so test
739
743
// what's best for your case.
740
744
//
741
745
// Tip. If our own packages (client packages for assert) have lots of parallel
742
746
// testing and race detection, please try to use same asserter for all of them
743
- // and do it only one in TestMain, or in init.
747
+ // and set asserter only one in TestMain, or in init.
744
748
//
745
749
// func TestMain(m *testing.M) {
746
750
// SetDefault(assert.TestFull)
You can’t perform that action at this time.
0 commit comments