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

Conversation

Projects
None yet
2 participants
@dmitshur
Copy link
Contributor

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

Add support for parsing header timestamps without fractional seconds.
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 referenced this pull request Oct 31, 2017

Closed

diff: fix time format #17

@sqs

sqs approved these changes Oct 31, 2017

Copy link
Member

left a comment

Thanks!

@sqs sqs merged commit c0b7156 into sourcegraph:master Oct 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dmitshur dmitshur deleted the dmitshur:parse-no-fractional-seconds branch Oct 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.