forked from TrueCloudLab/restic
s3: Move interfaces to function
This commit is contained in:
parent
3b44b87137
commit
250a45ab15
1 changed files with 8 additions and 8 deletions
|
@ -81,6 +81,9 @@ func (be *s3) Location() string {
|
||||||
return be.bucketname
|
return be.bucketname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 {
|
type Sizer interface {
|
||||||
Size() int64
|
Size() int64
|
||||||
}
|
}
|
||||||
|
@ -89,9 +92,6 @@ type Lenner interface {
|
||||||
Len() int
|
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) {
|
|
||||||
if r, ok := rd.(Lenner); ok {
|
if r, ok := rd.(Lenner); ok {
|
||||||
size = int64(r.Len())
|
size = int64(r.Len())
|
||||||
} else if r, ok := rd.(Sizer); ok {
|
} else if r, ok := rd.(Sizer); ok {
|
||||||
|
|
Loading…
Reference in a new issue