From a1840f6fc7522ff97728483088380579a603e1a8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 26 Jun 2019 11:24:48 +0100 Subject: [PATCH] sftp: add missing interface check and fix About #3257 This bug was introduced as part of adding context to the backends and slipped through the net because the About call did not have an interface assertion in the sftp backend. I checked there were no other missing interface assertions on all the optional methods on all the backends. --- backend/sftp/sftp.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index aaa70413b..54e45c295 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -807,7 +807,7 @@ func (f *Fs) Hashes() hash.Set { } // About gets usage stats -func (f *Fs) About() (*fs.Usage, error) { +func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { c, err := f.getSftpConnection() if err != nil { return nil, errors.Wrap(err, "About get SFTP connection") @@ -1188,5 +1188,6 @@ var ( _ fs.PutStreamer = &Fs{} _ fs.Mover = &Fs{} _ fs.DirMover = &Fs{} + _ fs.Abouter = &Fs{} _ fs.Object = &Object{} )