Skip to content
This repository was archived by the owner on Aug 31, 2019. It is now read-only.

Patch to Cause() function

Compare
Choose a tag to compare
@jjeffery jjeffery released this 31 Mar 03:54
· 4 commits to master since this release

This release patches the Cause(err error) function so that it will always return non-nil if its argument is non-nil.

A problem was encountered with the popular github.com/gorilla/securecookie package. Errors returned by this package have a Cause() method, but sometimes this method will return nil if there was no cause. This in turn would mean that the Cause(err error) function in this package would return nil, even though it was passed a non-nil error.

The implementation has changed now so that if Cause(err error) is passed a non-nil error, it will always return a non-nil value.