File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ func (e *Error) Is(target error) bool {
160
160
// Unwrap returns cause of current error in case it is wrapped transparently, nil otherwise.
161
161
// See also: errors.Unwrap()
162
162
func (e * Error ) Unwrap () error {
163
- if e .cause != nil && e .transparent {
163
+ if e != nil && e .cause != nil && e .transparent {
164
164
return e .cause
165
165
} else {
166
166
return nil
@@ -170,9 +170,9 @@ func (e *Error) Unwrap() error {
170
170
// Format implements the Formatter interface.
171
171
// Supported verbs:
172
172
//
173
- // %s simple message output
174
- // %v same as %s
175
- // %+v full output complete with a stack trace
173
+ // %s simple message output
174
+ // %v same as %s
175
+ // %+v full output complete with a stack trace
176
176
//
177
177
// In is nearly always preferable to use %+v format.
178
178
// If a stack trace is not required, it should be omitted at the moment of creation rather in formatting.
You can’t perform that action at this time.
0 commit comments