From 9b6cb04c6e808613e120cf9b1d99e7ba932300b2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 2 Nov 2012 13:36:33 +0100 Subject: [PATCH] pkg/index: remove pre-Go 1 trimRFC3339Subseconds Confirmed it's no longer needed. Change-Id: I83fdbec205476cd749c668e04b26a304c543e7b6 --- pkg/index/index.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/index/index.go b/pkg/index/index.go index 5b08fbd59..2ba24b46f 100644 --- a/pkg/index/index.go +++ b/pkg/index/index.go @@ -492,7 +492,7 @@ func (x *Index) PathLookup(signer, base *blobref.BlobRef, suffix string, at time } for _, path := range paths { - t, err := time.Parse(time.RFC3339, trimRFC3339Subseconds(path.ClaimDate)) + t, err := time.Parse(time.RFC3339, path.ClaimDate) if err != nil { continue } @@ -514,14 +514,6 @@ func (x *Index) PathLookup(signer, base *blobref.BlobRef, suffix string, at time return best, nil } -// TODO(bradfitz): remove this as of Go 1. shouldn't be needed anymore. -func trimRFC3339Subseconds(s string) string { - if !strings.HasSuffix(s, "Z") || len(s) < 20 || s[19] != '.' { - return s - } - return s[:19] + "Z" -} - func (x *Index) ExistingFileSchemas(wholeRef *blobref.BlobRef) (schemaRefs []*blobref.BlobRef, err error) { it := x.queryPrefix(keyWholeToFileRef, wholeRef) defer closeIterator(it, &err)