TimeFunc being static prevents from using this package in a parallel test
I tried to bring this TimeFunc on the ParserOptions, then pass it in the Claims
But I just saw a recent retraction of something very similar.
https://github.com/golang-jwt/jwt/pull/184
So, I would believe you will not accept a PR like mine until v5, but having the TimeFunc() local makes more sense for testing
https://github.com/jsgoupil/jwt/commit/a6c0c037dc35f72e1afc9a9628ae10837d4cc5bb
I hope you can consider this bug for a future release.
Thanks for opening this issue and linking to the PR.
I suggest keeping it open (maybe adding a /v5 label) so we make sure to consider it if/when thinking through what a future release would look like.
I tried to bring this
TimeFuncon theParserOptions, then pass it in theClaimsBut I just saw a recent retraction of something very similar.#184
So, I would believe you will not accept a PR like mine until v5, but having the
TimeFunc()local makes more sense for testingI hope you can consider this bug for a future release.
Did you by any chance have a look at the v5 branch. I added a feature that hopefully solves your issue here:
https://github.com/golang-jwt/jwt/pull/234/files#diff-72f644d282bce7e136d0f762de1b9d5f3e447bfa88e5e0c4974ac2479107ddc9R40-R47
Fixed by #234