From 148ceeb09cfec84e3dc156bd9dace243cc8282e5 Mon Sep 17 00:00:00 2001 From: Aaron Raddon Date: Fri, 5 Dec 2014 17:10:12 -0800 Subject: [PATCH] doc --- bench_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bench_test.go b/bench_test.go index 0b87270..df99f2c 100644 --- a/bench_test.go +++ b/bench_test.go @@ -19,12 +19,13 @@ func BenchmarkShotgunParse(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { for _, dateStr := range testDates { - parseShotgun(dateStr) + // This is the non dateparse traditional approach + parseShotgunStyle(dateStr) } } } -func BenchmarkDateparseParseAny(b *testing.B) { +func BenchmarkParseAny(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { for _, dateStr := range testDates { @@ -102,11 +103,8 @@ var ( ts, err = ParseAny() */ -// Normalizes a variety of string representations to a time.Time in UTC. -func parseShotgun(raw string) (time.Time, error) { +func parseShotgunStyle(raw string) (time.Time, error) { - // We shouldn't need these, dupes of above - // Well it's not a UNIX timestamp, try ISO standards for _, format := range timeFormats { t, err := time.Parse(format, raw) if err == nil {