@@ -18,22 +18,28 @@ type defInd = uint32
18
18
19
19
const (
20
20
// Plain converts asserts just plain K&D error messages without extra
21
- // information.
21
+ // information. That's useful for apps that want to use assert package to
22
+ // validate e.g. command fields:
23
+ //
24
+ // assert.NotEmpty(c.PoolName, "pool name cannot be empty")
25
+ //
26
+ // Note, that Plain is only asserter that override auto-generated assertion
27
+ // messages with given arguments like 'pool name cannot be empty'. Others
28
+ // add given arguments at the end of the auto-generated assert message.
22
29
Plain defInd = 0 + iota
23
30
24
- // Production (pkg default) is the best asserter for most uses . The
31
+ // Production (pkg default) is the best asserter for most cases . The
25
32
// assertion violations are treated as Go error values. And only a
26
- // pragmatic caller info is automatically included into the error message
27
- // like file name , line number, and caller function, all in one line:
33
+ // pragmatic caller info is included into the error values like source
34
+ // filename , line number, and caller function, all in one line:
28
35
//
29
36
// copy file: main.go:37: CopyFile(): assertion violation: string shouldn't be empty
30
37
Production
31
38
32
- // Development is the best asserter for most development uses. The
33
- // assertion violations are treated as Go error values. And a formatted
34
- // caller info is automatically included to the error message like file
35
- // name, line number, and caller function. Everything in a beautiful
36
- // multi-line message:
39
+ // Development is the best asserter for development use. The assertion
40
+ // violations are treated as Go error values. And a formatted caller info
41
+ // is included to the error message like source filename , line number, and
42
+ // caller function. Everything in a noticeable multi-line message:
37
43
//
38
44
// --------------------------------
39
45
// Assertion Fault at:
0 commit comments