New features:
NewNotFoundResponder
helps to detect a possible path mistake (final/
or double/
cases);- add
(*MockTransport).Responders
method allowing to list registered responders.
Fixes:
-
url.RawPath
is used instead ofurl.Path
when checking path alone for consistency with full URL check, which is always unescaped.
Let 2 registered responders:GET http://z.tld/foo%2fbar
GET /foo%2fbar
Before this release:
GET http://z.tld/foo%2fbar
is caught by 1GET http://unknown.tld/foo%2fbar
is not caught as the tested path is/foo/bar
instead of/foo%2fbar
From this release:
GET http://z.tld/foo%2fbar
is caught by 1GET http://unknown.tld/foo%2fbar
is caught by 2
-
save of old clients transports is now protected from concurrent writes (@roboslone).
Miscellaneous:
- now use go-testdeep to simplify tests (saves >500 test lines);
- go minimal version required is now 1.9;
- CI tests using go1.18 & golangci-lint v1.45.0;
- signatures (and so documentation) now use
any
type instead ofinterface{}
, as appeared in go 1.18 (in a compatible manner with go<1.18).
Enjoy!