-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"1.jpg" is incorrectly matched as a date #108
Comments
Not sure this one is fixable or will be fixed, probably will close as wnf: https://play.golang.org/p/NY-m3OnWkKA This really passes down to underlying go parser to determine correctness, it doesn't do a ton of additional error testing beyond validating it can parse it. Since go parser says that is a valid format, not sure this lib will attempt beyond that. open to arguments counter, but seems like an impossible chase to find invalid formats beyond that. package main
import (
"fmt"
"time"
)
func main() {
t, err := time.ParseInLocation("1.jpg", "1.jpg", time.UTC)
fmt.Printf("hello t=%v IsZero()=%v err=%v", t, t.IsZero(), err)
} |
@araddon Although it's sad, but it fits the module description:
Maybe you could highlight in readme, that this package isn't able to detect if the string is a date string. It can be used for date string detection, but not without false positives. It should be said at laud. |
* Don't just assume we were given one of the valid formats. * Also consolidate the parsing states that occur after timePeriod. * Add subtests to make it easier to see what fails. * Additional tests for 4-char timezone names. * Fix araddon#117 * Fix araddon#150 * Fix araddon#157 * Fix araddon#145 * Fix araddon#108 * Fix araddon#137 * Fix araddon#130 * Fix araddon#123 * Fix araddon#109 * Fix araddon#98 * Addresses bug in araddon#100 (comment) Adds test cases to verify the following are already fixed: * araddon#94
The following code prints:
Matched 1.jpg as date with format 1.jpg
The text was updated successfully, but these errors were encountered: