Must panics if err is not nil.
(err error)
| 18 | |
| 19 | // Must panics if err is not nil. |
| 20 | func Must(err error) { |
| 21 | if err != nil { |
| 22 | panic(err) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Must2 panics if the second parameter is not nil, otherwise returns the first parameter. |
| 27 | // This is useful when function returned "sth, err" and avoid many "if err != nil" |
no outgoing calls
searching dependent graphs…