lestrrat-go / strftime

Fast strftime for Go
MIT License
110 stars 21 forks source link

If you have a number before a specification, it breaks the compiled pattern #9

Closed aaronchipper closed 4 years ago

aaronchipper commented 4 years ago

Whilst using this library, I found an interesting bug(?) issue(?) to create log file names.

If I use: pattern, _ := strftime.New("/path/test%Y%m%d.log") I get pattern -> "/path/test20191230.log" Awesome.

But. If I use: pattern, _ := strftime.New("/path/test1%Y%m%d.log") I get pattern -> ".log20191230.log" Not awesome.

If I try: pattern, _ := strftime.New("/longer/path/to/see/where/this/leads//test99%Y%m%d.log") I get pattern -> ".log20191230.log" Also not awesome.

This has only started post PR#6 as far as I can tell, as I have an older forked version that does not have this issue.

Am I going mad?

lestrrat commented 4 years ago

can confirm. seems like a bug.

lestrrat commented 4 years ago

@aaronchipper can you please check this PR #10

lestrrat commented 4 years ago

This issue didn't get automatically closed via #10. oops. Closing