pkg/index: remove pre-Go 1 trimRFC3339Subseconds

Confirmed it's no longer needed.

Change-Id: I83fdbec205476cd749c668e04b26a304c543e7b6
This commit is contained in:
Brad Fitzpatrick 2012-11-02 13:36:33 +01:00
parent 22495f8bfd
commit 9b6cb04c6e
1 changed files with 1 additions and 9 deletions

View File

@ -492,7 +492,7 @@ func (x *Index) PathLookup(signer, base *blobref.BlobRef, suffix string, at time
} }
for _, path := range paths { for _, path := range paths {
t, err := time.Parse(time.RFC3339, trimRFC3339Subseconds(path.ClaimDate)) t, err := time.Parse(time.RFC3339, path.ClaimDate)
if err != nil { if err != nil {
continue continue
} }
@ -514,14 +514,6 @@ func (x *Index) PathLookup(signer, base *blobref.BlobRef, suffix string, at time
return best, nil 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) { func (x *Index) ExistingFileSchemas(wholeRef *blobref.BlobRef) (schemaRefs []*blobref.BlobRef, err error) {
it := x.queryPrefix(keyWholeToFileRef, wholeRef) it := x.queryPrefix(keyWholeToFileRef, wholeRef)
defer closeIterator(it, &err) defer closeIterator(it, &err)