From 250a45ab15587909133a0336b8ad55fa5e9bc68c Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 14 May 2017 20:36:26 +0200 Subject: [PATCH] s3: Move interfaces to function --- src/restic/backend/s3/s3.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/restic/backend/s3/s3.go b/src/restic/backend/s3/s3.go index 56cf71249..9afd13df5 100644 --- a/src/restic/backend/s3/s3.go +++ b/src/restic/backend/s3/s3.go @@ -81,17 +81,17 @@ func (be *s3) Location() string { return be.bucketname } -type Sizer interface { - Size() int64 -} - -type Lenner interface { - Len() int -} - // getRemainingSize returns number of bytes remaining. If it is not possible to // determine the size, panic() is called. func getRemainingSize(rd io.Reader) (size int64, err error) { + type Sizer interface { + Size() int64 + } + + type Lenner interface { + Len() int + } + if r, ok := rd.(Lenner); ok { size = int64(r.Len()) } else if r, ok := rd.(Sizer); ok {