araddon / dateparse

GoLang Parse many date strings without knowing format in advance.
MIT License
2.03k stars 164 forks source link

Fix possible panic #124

Closed radaiming closed 3 years ago

radaiming commented 3 years ago

When parse invalid date with RetryAmbiguousDateWithSwap(true) option, returned p will be nil, and the deffered function will panic, the added test could reproduce the issue.

codecov-commenter commented 3 years ago

Codecov Report

Merging #124 (5dd51ed) into master (0eec95c) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #124   +/-   ##
=======================================
  Coverage   99.90%   99.90%           
=======================================
  Files           1        1           
  Lines        1021     1021           
=======================================
  Hits         1020     1020           
  Misses          1        1           
Impacted Files Coverage Δ
parseany.go 99.90% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0eec95c...5dd51ed. Read the comment docs.