Skip to content
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

Add support for parsing header timestamps without fractional seconds. #18

Merged
merged 1 commit into from
Oct 31, 2017
Merged

Add support for parsing header timestamps without fractional seconds. #18

merged 1 commit into from
Oct 31, 2017

Conversation

dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Oct 31, 2017

We need to use a different layout string for parsing and printing, since we only want to change the parsing behavior (not printing behavior).

Add test for it. Without the change to parsing layout, the test fails with:

$ go test
--- FAIL: TestParseFileDiffHeaders (0.00s)
	diff_test.go:214: sample_file_no_fractional_seconds.diff: got ParseFileDiff error parsing time "2011-11-24 19:47:20 +0000" as "2006-01-02 15:04:05.000000000 -0700": cannot parse " +0000" as ".000000000"
FAIL
FAIL	sourcegraph.com/sourcegraph/go-diff/diff	0.010s

Resolves #17. /cc @rogpeppe

We need to use a different layout string for parsing and printing,
since we only want to change the parsing behavior (not printing
behavior).

Add test for it.

Resolves #17.
@dmitshur dmitshur mentioned this pull request Oct 31, 2017
Copy link
Member

@sqs sqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sqs sqs merged commit c0b7156 into sourcegraph:master Oct 31, 2017
@dmitshur dmitshur deleted the parse-no-fractional-seconds branch October 31, 2017 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants