From 6fd9e3d7170551b8272e08a206ae5d8fbf1ecebf Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 5 Aug 2022 16:35:41 +0100 Subject: [PATCH] build: reformat comments to pass go1.19 vet See: https://go.dev/doc/go1.19#go-doc --- backend/amazonclouddrive/amazonclouddrive.go | 13 ++-- backend/azureblob/azureblob.go | 26 +++---- backend/b2/b2.go | 52 +++++++------- backend/box/box.go | 21 +++--- backend/chunker/chunker.go | 18 ++--- backend/combine/combine.go | 8 +-- backend/compress/compress.go | 8 +-- backend/crypt/cipher.go | 12 ++-- backend/crypt/crypt.go | 8 +-- backend/drive/drive.go | 13 ++-- backend/dropbox/dropbox.go | 12 ++-- backend/filefabric/filefabric.go | 17 +++-- backend/ftp/ftp.go | 13 ++-- .../googlecloudstorage/googlecloudstorage.go | 8 +-- backend/googlephotos/googlephotos.go | 2 +- backend/googlephotos/pattern.go | 2 +- backend/hdfs/fs.go | 4 +- backend/internetarchive/internetarchive.go | 4 +- backend/jottacloud/jottacloud.go | 12 ++-- backend/local/local.go | 4 +- backend/local/setbtime_windows.go | 2 +- backend/mailru/mailru.go | 7 +- backend/mega/mega.go | 15 ++-- backend/memory/memory.go | 6 +- backend/onedrive/api/types.go | 6 +- backend/onedrive/onedrive.go | 15 ++-- backend/opendrive/opendrive.go | 13 ++-- backend/pcloud/pcloud.go | 15 ++-- backend/premiumizeme/premiumizeme.go | 15 ++-- backend/putio/fs.go | 10 +-- backend/putio/object.go | 2 +- backend/qingstor/qingstor.go | 6 +- backend/s3/s3.go | 8 +-- backend/seafile/seafile.go | 8 +-- backend/sharefile/sharefile.go | 19 +++--- backend/storj/fs.go | 4 +- backend/sugarsync/sugarsync.go | 19 +++--- backend/swift/swift.go | 18 ++--- backend/union/union.go | 8 +-- backend/uptobox/uptobox.go | 2 +- backend/webdav/api/types.go | 68 ++++++++++--------- backend/webdav/webdav.go | 16 ++--- backend/yandex/api/types.go | 4 +- backend/yandex/yandex.go | 14 ++-- backend/zoho/zoho.go | 17 +++-- cmd/bisync/bisync_test.go | 3 +- cmd/bisync/listing.go | 4 +- cmd/cmount/mount_brew.go | 2 +- cmd/cmount/mountpoint_windows.go | 2 +- cmd/serve/docker/options.go | 20 +++--- cmd/serve/ftp/ftp.go | 39 +++++------ cmdtest/cmdtest.go | 1 - fs/bwtimetable.go | 2 +- fs/chunksize/chunksize.go | 12 ++-- fs/config/authorize.go | 6 +- fs/filter/filter.go | 4 +- fs/log.go | 16 ++--- fs/mount_helper.go | 4 +- fs/open_options.go | 8 +-- fs/operations/operations.go | 8 +-- fs/operations/rc_test.go | 3 +- fs/operations/reopen.go | 2 +- fs/rc/params.go | 1 - fs/rc/webgui/plugins.go | 4 +- fs/registry.go | 14 ++-- fs/sync/sync.go | 11 +-- fs/walk/walk.go | 2 +- fstest/fstests/fstests.go | 2 +- fstest/test_all/test_all.go | 1 - lib/atexit/atexit.go | 2 +- lib/bucket/bucket.go | 2 +- lib/dircache/dircache.go | 10 +-- lib/encoder/os_windows.go | 22 +++--- lib/encoder/standard.go | 5 +- lib/errors/errors.go | 9 +-- lib/oauthutil/oauthutil.go | 10 +-- lib/pacer/pacer.go | 2 +- lib/plugin/package.go | 2 +- lib/rest/rest.go | 6 +- librclone/gomobile/gomobile.go | 4 +- librclone/librclone.go | 16 ++--- librclone/librclone/librclone.go | 2 +- vfs/dir.go | 2 +- vfs/file.go | 16 ++--- vfs/help.go | 3 +- vfs/read.go | 2 +- vfs/read_write.go | 2 +- vfs/vfscache/cache.go | 2 +- vfs/vfscache/downloaders/downloaders.go | 4 +- vfs/vfscache/downloaders/downloaders_test.go | 2 +- vfs/vfscache/item.go | 8 +-- vfs/vfscache/writeback/writeback.go | 2 +- vfs/vfstest/submount.go | 7 +- 93 files changed, 444 insertions(+), 443 deletions(-) diff --git a/backend/amazonclouddrive/amazonclouddrive.go b/backend/amazonclouddrive/amazonclouddrive.go index e5f5512ed..1bc6bcb84 100644 --- a/backend/amazonclouddrive/amazonclouddrive.go +++ b/backend/amazonclouddrive/amazonclouddrive.go @@ -556,9 +556,9 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // // This is a workaround for Amazon sometimes returning // -// * 408 REQUEST_TIMEOUT -// * 504 GATEWAY_TIMEOUT -// * 500 Internal server error +// - 408 REQUEST_TIMEOUT +// - 504 GATEWAY_TIMEOUT +// - 500 Internal server error // // At the end of large uploads. The speculation is that the timeout // is waiting for the sha1 hashing to complete and the file may well @@ -626,7 +626,7 @@ func (f *Fs) checkUpload(ctx context.Context, resp *http.Response, in io.Reader, // Put the object into the container // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -685,9 +685,9 @@ func (f *Fs) Mkdir(ctx context.Context, dir string) error { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1002,7 +1002,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go index 5597ed21f..0814b0168 100644 --- a/backend/azureblob/azureblob.go +++ b/backend/azureblob/azureblob.go @@ -1115,7 +1115,7 @@ func (f *Fs) listContainersToFn(fn listContainerFn) error { // Put the object into the container // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -1247,9 +1247,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1356,11 +1356,12 @@ func (o *Object) setMetadata(metadata azblob.Metadata) { // decodeMetaDataFromPropertiesResponse sets the metadata from the data passed in // // Sets -// o.id -// o.modTime -// o.size -// o.md5 -// o.meta +// +// o.id +// o.modTime +// o.size +// o.md5 +// o.meta func (o *Object) decodeMetaDataFromPropertiesResponse(info *azblob.BlobGetPropertiesResponse) (err error) { metadata := info.NewMetadata() size := info.ContentLength() @@ -1443,10 +1444,11 @@ func (o *Object) clearMetaData() { // readMetaData gets the metadata if it hasn't already been fetched // // Sets -// o.id -// o.modTime -// o.size -// o.md5 +// +// o.id +// o.modTime +// o.size +// o.md5 func (o *Object) readMetaData() (err error) { container, _ := o.split() if !o.fs.containerOK(container) { diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 322aa50a5..6fd77b6a0 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -656,15 +656,15 @@ var errEndList = errors.New("end list") // // (bucket, directory) is the starting directory // -// If prefix is set then it is removed from all file names +// If prefix is set then it is removed from all file names. // // If addBucket is set then it adds the bucket to the start of the -// remotes generated +// remotes generated. // -// If recurse is set the function will recursively list +// If recurse is set the function will recursively list. // // If limit is > 0 then it limits to that many files (must be less -// than 1000) +// than 1000). // // If hidden is set then it will list the hidden (deleted) files too. // @@ -1025,7 +1025,7 @@ func (f *Fs) clearBucketID(bucket string) { // Put the object into the bucket // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -1334,9 +1334,9 @@ func (f *Fs) copy(ctx context.Context, dstObj *Object, srcObj *Object, newInfo * // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1478,7 +1478,7 @@ func (o *Object) Size() int64 { // Clean the SHA1 // -// Make sure it is lower case +// Make sure it is lower case. // // Remove unverified prefix - see https://www.backblaze.com/b2/docs/uploading.html // Some tools (e.g. Cyberduck) use this @@ -1490,10 +1490,11 @@ func cleanSHA1(sha1 string) string { // decodeMetaDataRaw sets the metadata from the data passed in // // Sets -// o.id -// o.modTime -// o.size -// o.sha1 +// +// o.id +// o.modTime +// o.size +// o.sha1 func (o *Object) decodeMetaDataRaw(ID, SHA1 string, Size int64, UploadTimestamp api.Timestamp, Info map[string]string, mimeType string) (err error) { o.id = ID o.sha1 = SHA1 @@ -1512,10 +1513,11 @@ func (o *Object) decodeMetaDataRaw(ID, SHA1 string, Size int64, UploadTimestamp // decodeMetaData sets the metadata in the object from an api.File // // Sets -// o.id -// o.modTime -// o.size -// o.sha1 +// +// o.id +// o.modTime +// o.size +// o.sha1 func (o *Object) decodeMetaData(info *api.File) (err error) { return o.decodeMetaDataRaw(info.ID, info.SHA1, info.Size, info.UploadTimestamp, info.Info, info.ContentType) } @@ -1523,10 +1525,11 @@ func (o *Object) decodeMetaData(info *api.File) (err error) { // decodeMetaDataFileInfo sets the metadata in the object from an api.FileInfo // // Sets -// o.id -// o.modTime -// o.size -// o.sha1 +// +// o.id +// o.modTime +// o.size +// o.sha1 func (o *Object) decodeMetaDataFileInfo(info *api.FileInfo) (err error) { return o.decodeMetaDataRaw(info.ID, info.SHA1, info.Size, info.UploadTimestamp, info.Info, info.ContentType) } @@ -1584,10 +1587,11 @@ func (o *Object) getMetaData(ctx context.Context) (info *api.File, err error) { // readMetaData gets the metadata if it hasn't already been fetched // // Sets -// o.id -// o.modTime -// o.size -// o.sha1 +// +// o.id +// o.modTime +// o.size +// o.sha1 func (o *Object) readMetaData(ctx context.Context) (err error) { if o.id != "" { return nil diff --git a/backend/box/box.go b/backend/box/box.go index 55d8a4030..93b2cd0cc 100644 --- a/backend/box/box.go +++ b/backend/box/box.go @@ -692,7 +692,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -752,7 +752,7 @@ func (f *Fs) preUploadCheck(ctx context.Context, leaf, directoryID string, size // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -792,9 +792,9 @@ func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, opt // PutUnchecked the object into the container // -// This will produce an error if the object already exists +// This will produce an error if the object already exists. // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -877,9 +877,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -995,9 +995,9 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1235,7 +1235,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1346,9 +1345,9 @@ func (o *Object) upload(ctx context.Context, in io.Reader, leaf, directoryID str // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // -// The new object may have been created if an error is returned +// The new object may have been created if an error is returned. func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { if o.fs.tokenRenewer != nil { o.fs.tokenRenewer.Start() diff --git a/backend/chunker/chunker.go b/backend/chunker/chunker.go index bfb3e3e65..4ed8ec9e8 100644 --- a/backend/chunker/chunker.go +++ b/backend/chunker/chunker.go @@ -32,7 +32,6 @@ import ( "github.com/rclone/rclone/fs/operations" ) -// // Chunker's composite files have one or more chunks // and optional metadata object. If it's present, // meta object is named after the original file. @@ -79,7 +78,6 @@ import ( // Metadata format v1 does not define any control chunk types, // they are currently ignored aka reserved. // In future they can be used to implement resumable uploads etc. -// const ( ctrlTypeRegStr = `[a-z][a-z0-9]{2,6}` tempSuffixFormat = `_%04s` @@ -542,7 +540,6 @@ func (f *Fs) setChunkNameFormat(pattern string) error { // // xactID is a transaction identifier. Empty xactID denotes active chunk, // otherwise temporary chunk name is produced. -// func (f *Fs) makeChunkName(filePath string, chunkNo int, ctrlType, xactID string) string { dir, parentName := path.Split(filePath) var name, tempSuffix string @@ -708,7 +705,6 @@ func (f *Fs) newXactID(ctx context.Context, filePath string) (xactID string, err // directory together with dead chunks. // In future a flag named like `--chunker-list-hidden` may be added to // rclone that will tell List to reveal hidden chunks. -// func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) { entries, err = f.base.List(ctx, dir) if err != nil { @@ -868,7 +864,6 @@ func (f *Fs) processEntries(ctx context.Context, origEntries fs.DirEntries, dirP // Note that chunker prefers analyzing file names rather than reading // the content of meta object assuming that directory scans are fast // but opening even a small file can be slow on some backends. -// func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { return f.scanObject(ctx, remote, false) } @@ -1586,7 +1581,6 @@ func (f *Fs) Rmdir(ctx context.Context, dir string) error { // This command will chain to `purge` from wrapped remote. // As a result it removes not only composite chunker files with their // active chunks but also all hidden temporary chunks in the directory. -// func (f *Fs) Purge(ctx context.Context, dir string) error { do := f.base.Features().Purge if do == nil { @@ -1628,7 +1622,6 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Unsupported control chunks will get re-picked by a more recent // rclone version with unexpected results. This can be helped by // the `delete hidden` flag above or at least the user has been warned. -// func (o *Object) Remove(ctx context.Context) (err error) { if err := o.f.forbidChunk(o, o.Remote()); err != nil { // operations.Move can still call Remove if chunker's Move refuses @@ -1804,9 +1797,9 @@ func (f *Fs) okForServerSide(ctx context.Context, src fs.Object, opName string) // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1825,9 +1818,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -2125,7 +2118,6 @@ func (o *Object) SetModTime(ctx context.Context, mtime time.Time) error { // file, then tries to read it from metadata. This in theory // handles the unusual case when a small file has been tampered // on the level of wrapped remote but chunker is unaware of that. -// func (o *Object) Hash(ctx context.Context, hashType hash.Type) (string, error) { if err := o.readMetadata(ctx); err != nil { return "", err // valid metadata is required to get hash, abort @@ -2414,7 +2406,6 @@ type metaSimpleJSON struct { // - for files larger than chunk size // - if file contents can be mistaken as meta object // - if consistent hashing is On but wrapped remote can't provide given hash -// func marshalSimpleJSON(ctx context.Context, size int64, nChunks int, md5, sha1, xactID string) ([]byte, error) { version := metadataVersion if xactID == "" && version == 2 { @@ -2447,7 +2438,6 @@ func marshalSimpleJSON(ctx context.Context, size int64, nChunks int, md5, sha1, // New format will have a higher version number and cannot be correctly // handled by current implementation. // The version check below will then explicitly ask user to upgrade rclone. -// func unmarshalSimpleJSON(ctx context.Context, metaObject fs.Object, data []byte) (info *ObjectInfo, madeByChunker bool, err error) { // Be strict about JSON format // to reduce possibility that a random small file resembles metadata. diff --git a/backend/combine/combine.go b/backend/combine/combine.go index bae4bd8a1..dab80a82b 100644 --- a/backend/combine/combine.go +++ b/backend/combine/combine.go @@ -457,9 +457,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -491,9 +491,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/compress/compress.go b/backend/compress/compress.go index 9033b38ff..b53e725b8 100644 --- a/backend/compress/compress.go +++ b/backend/compress/compress.go @@ -785,9 +785,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Copy src to this remote using server side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -835,9 +835,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/crypt/cipher.go b/backend/crypt/cipher.go index 1b265ad19..10485776b 100644 --- a/backend/crypt/cipher.go +++ b/backend/crypt/cipher.go @@ -127,8 +127,8 @@ type fileNameEncoding interface { // RFC4648 // // The standard encoding is modified in two ways -// * it becomes lower case (no-one likes upper case filenames!) -// * we strip the padding character `=` +// - it becomes lower case (no-one likes upper case filenames!) +// - we strip the padding character `=` type caseInsensitiveBase32Encoding struct{} // EncodeToString encodes a strign using the modified version of @@ -244,7 +244,7 @@ func (c *Cipher) putBlock(buf []byte) { // encryptSegment encrypts a path segment // -// This uses EME with AES +// This uses EME with AES. // // EME (ECB-Mix-ECB) is a wide-block encryption mode presented in the // 2003 paper "A Parallelizable Enciphering Mode" by Halevi and @@ -254,8 +254,8 @@ func (c *Cipher) putBlock(buf []byte) { // same filename must encrypt to the same thing. // // This means that -// * filenames with the same name will encrypt the same -// * filenames which start the same won't have a common prefix +// - filenames with the same name will encrypt the same +// - filenames which start the same won't have a common prefix func (c *Cipher) encryptSegment(plaintext string) string { if plaintext == "" { return "" @@ -1085,7 +1085,7 @@ func (c *Cipher) DecryptData(rc io.ReadCloser) (io.ReadCloser, error) { // DecryptDataSeek decrypts the data stream from offset // -// The open function must return a ReadCloser opened to the offset supplied +// The open function must return a ReadCloser opened to the offset supplied. // // You must use this form of DecryptData if you might want to Seek the file handle func (c *Cipher) DecryptDataSeek(ctx context.Context, open OpenRangeSeek, offset, limit int64) (ReadSeekCloser, error) { diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.go index 6f599cafb..bae2c9799 100644 --- a/backend/crypt/crypt.go +++ b/backend/crypt/crypt.go @@ -507,9 +507,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -532,9 +532,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/drive/drive.go b/backend/drive/drive.go index d2f92d692..b4f310eaf 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -2180,7 +2180,7 @@ func (f *Fs) createFileInfo(ctx context.Context, remote string, modTime time.Tim // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -2414,9 +2414,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -2649,9 +2649,9 @@ func (f *Fs) About(ctx context.Context) (*fs.Usage, error) { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -3569,7 +3569,6 @@ func (f *Fs) getRemoteInfoWithExport(ctx context.Context, remote string) ( // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *baseObject) ModTime(ctx context.Context) time.Time { @@ -3826,7 +3825,7 @@ func (o *baseObject) update(ctx context.Context, updateInfo *drive.File, uploadM // Update the already existing object // -// Copy the reader into the object updating modTime and size +// Copy the reader into the object updating modTime and size. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { diff --git a/backend/dropbox/dropbox.go b/backend/dropbox/dropbox.go index ca026e8c9..42686394d 100644 --- a/backend/dropbox/dropbox.go +++ b/backend/dropbox/dropbox.go @@ -925,7 +925,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -1044,9 +1044,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1105,9 +1105,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) (err error) { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1763,7 +1763,7 @@ func checkPathLength(name string) (err error) { // Update the already existing object // -// Copy the reader into the object updating modTime and size +// Copy the reader into the object updating modTime and size. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { diff --git a/backend/filefabric/filefabric.go b/backend/filefabric/filefabric.go index a70e1f7ae..fa3e7a178 100644 --- a/backend/filefabric/filefabric.go +++ b/backend/filefabric/filefabric.go @@ -373,7 +373,7 @@ type params map[string]interface{} // rpc calls the rpc.php method of the SME file fabric // -// This is an entry point to all the method calls +// This is an entry point to all the method calls. // // If result is nil then resp.Body will need closing func (f *Fs) rpc(ctx context.Context, function string, p params, result api.OKError, options []fs.OpenOption) (resp *http.Response, err error) { @@ -678,7 +678,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -697,7 +697,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -783,9 +783,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -956,9 +956,9 @@ func (f *Fs) move(ctx context.Context, isDir bool, id, oldLeaf, newLeaf, oldDire // Move src to this remote using server side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1135,7 +1135,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1201,7 +1200,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go index d92678f08..24916d161 100644 --- a/backend/ftp/ftp.go +++ b/backend/ftp/ftp.go @@ -769,11 +769,12 @@ func (f *Fs) Hashes() hash.Set { // Precision shows whether modified time is supported or not depending on the // FTP server capabilities, namely whether FTP server: -// - accepts the MDTM command to get file time (fGetTime) -// or supports MLSD returning precise file time in the list (fLstTime) -// - accepts the MFMT command to set file time (fSetTime) -// or non-standard form of the MDTM command (fSetTime, too) -// used by VsFtpd for the same purpose (WritingMDTM) +// - accepts the MDTM command to get file time (fGetTime) +// or supports MLSD returning precise file time in the list (fLstTime) +// - accepts the MFMT command to set file time (fSetTime) +// or non-standard form of the MDTM command (fSetTime, too) +// used by VsFtpd for the same purpose (WritingMDTM) +// // See "mdtm_write" in https://security.appspot.com/vsftpd/vsftpd_conf.html func (f *Fs) Precision() time.Duration { if (f.fGetTime || f.fLstTime) && f.fSetTime { @@ -1149,7 +1150,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (rc io.Read // Update the already existing object // -// Copy the reader into the object updating modTime and size +// Copy the reader into the object updating modTime and size. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.go index b4d355021..0e6a2b4ed 100644 --- a/backend/googlecloudstorage/googlecloudstorage.go +++ b/backend/googlecloudstorage/googlecloudstorage.go @@ -580,7 +580,7 @@ type listFn func(remote string, object *storage.Object, isDirectory bool) error // // dir is the starting directory, "" for root // -// Set recurse to read sub directories +// Set recurse to read sub directories. // // The remote has prefix removed from it and if addBucket is set // then it adds the bucket to the start. @@ -798,7 +798,7 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( // Put the object into the bucket // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -900,9 +900,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/googlephotos/googlephotos.go b/backend/googlephotos/googlephotos.go index 4e16d81d3..238d6c783 100644 --- a/backend/googlephotos/googlephotos.go +++ b/backend/googlephotos/googlephotos.go @@ -661,7 +661,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Put the object into the bucket // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { diff --git a/backend/googlephotos/pattern.go b/backend/googlephotos/pattern.go index e2cbcbf72..fc84f4a0e 100644 --- a/backend/googlephotos/pattern.go +++ b/backend/googlephotos/pattern.go @@ -315,7 +315,7 @@ func yearMonthDayFilter(ctx context.Context, f lister, match []string) (sf api.S // featureFilter creates a filter for the Feature enum // -// The API only supports one feature, FAVORITES, so hardcode that feature +// The API only supports one feature, FAVORITES, so hardcode that feature. // // https://developers.google.com/photos/library/reference/rest/v1/mediaItems/search#FeatureFilter func featureFilter(ctx context.Context, f lister, match []string) (sf api.SearchFilter) { diff --git a/backend/hdfs/fs.go b/backend/hdfs/fs.go index a68372db6..7d48ffed6 100644 --- a/backend/hdfs/fs.go +++ b/backend/hdfs/fs.go @@ -265,9 +265,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/internetarchive/internetarchive.go b/backend/internetarchive/internetarchive.go index db553eda1..b3d4a55cb 100644 --- a/backend/internetarchive/internetarchive.go +++ b/backend/internetarchive/internetarchive.go @@ -577,9 +577,9 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration, // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go index 3bdc98ec6..0044c7f79 100644 --- a/backend/jottacloud/jottacloud.go +++ b/backend/jottacloud/jottacloud.go @@ -1247,7 +1247,7 @@ func (f *Fs) createObject(remote string, modTime time.Time, size int64) (o *Obje // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -1397,9 +1397,9 @@ func (f *Fs) copyOrMove(ctx context.Context, method, src, dest string) (info *ap // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1433,9 +1433,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1829,7 +1829,7 @@ func readMD5(in io.Reader, size, threshold int64) (md5sum string, out io.Reader, // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/local/local.go b/backend/local/local.go index 3a83bd262..c625b4260 100644 --- a/backend/local/local.go +++ b/backend/local/local.go @@ -695,9 +695,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/local/setbtime_windows.go b/backend/local/setbtime_windows.go index 3734c2e7b..2b8fd98d5 100644 --- a/backend/local/setbtime_windows.go +++ b/backend/local/setbtime_windows.go @@ -5,8 +5,8 @@ package local import ( "os" - "time" "syscall" + "time" ) const haveSetBTime = true diff --git a/backend/mailru/mailru.go b/backend/mailru/mailru.go index a9a9bab2d..bd527e8e2 100644 --- a/backend/mailru/mailru.go +++ b/backend/mailru/mailru.go @@ -630,9 +630,10 @@ func (f *Fs) readItemMetaData(ctx context.Context, path string) (entry fs.DirEnt // itemToEntry converts API item to rclone directory entry // The dirSize return value is: -// <0 - for a file or in case of error -// =0 - for an empty directory -// >0 - for a non-empty directory +// +// <0 - for a file or in case of error +// =0 - for an empty directory +// >0 - for a non-empty directory func (f *Fs) itemToDirEntry(ctx context.Context, item *api.ListItem) (entry fs.DirEntry, dirSize int, err error) { remote, err := f.relPath(f.opt.Enc.ToStandardPath(item.Home)) if err != nil { diff --git a/backend/mega/mega.go b/backend/mega/mega.go index 7e154fe2d..bb038506b 100644 --- a/backend/mega/mega.go +++ b/backend/mega/mega.go @@ -118,7 +118,7 @@ type Fs struct { // Object describes a mega object // -// Will definitely have info but maybe not meta +// Will definitely have info but maybe not meta. // // Normally rclone would just store an ID here but go-mega and mega.nz // expect you to build an entire tree of all the objects in memory. @@ -536,7 +536,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the dirNode, object, leaf and error +// Returns the dirNode, object, leaf and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, dirNode *mega.Node, leaf string, err error) { @@ -554,7 +554,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned // PutUnchecked uploads the object @@ -576,7 +576,7 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // PutUnchecked the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned // PutUnchecked uploads the object @@ -749,9 +749,9 @@ func (f *Fs) move(ctx context.Context, dstRemote string, srcFs *Fs, srcRemote st // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -979,7 +979,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1115,7 +1114,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/memory/memory.go b/backend/memory/memory.go index 9675abcd3..838a060d5 100644 --- a/backend/memory/memory.go +++ b/backend/memory/memory.go @@ -418,7 +418,7 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( // Put the object into the bucket // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -463,9 +463,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/onedrive/api/types.go b/backend/onedrive/api/types.go index 236c1c682..12dca863b 100644 --- a/backend/onedrive/api/types.go +++ b/backend/onedrive/api/types.go @@ -250,8 +250,8 @@ type MoveItemRequest struct { FileSystemInfo *FileSystemInfoFacet `json:"fileSystemInfo,omitempty"` // File system information on client. Read-write. } -//CreateShareLinkRequest is the request to create a sharing link -//Always Type:view and Scope:anonymous for public sharing +// CreateShareLinkRequest is the request to create a sharing link +// Always Type:view and Scope:anonymous for public sharing type CreateShareLinkRequest struct { Type string `json:"type"` // Link type in View, Edit or Embed Scope string `json:"scope,omitempty"` // Scope in anonymous, organization @@ -259,7 +259,7 @@ type CreateShareLinkRequest struct { Expiry *time.Time `json:"expirationDateTime,omitempty"` // A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission. } -//CreateShareLinkResponse is the response from CreateShareLinkRequest +// CreateShareLinkResponse is the response from CreateShareLinkRequest type CreateShareLinkResponse struct { ID string `json:"id"` Roles []string `json:"roles"` diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index b209b18f4..c0674c9c5 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -727,7 +727,7 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, err // "shared with me" folders in OneDrive Personal (See #2536, #2778) // This path pattern comes from https://github.com/OneDrive/onedrive-api-docs/issues/908#issuecomment-417488480 // -// If `relPath` == '', do not append the slash (See #3664) +// If `relPath` == ”, do not append the slash (See #3664) func (f *Fs) readMetaDataForPathRelativeToID(ctx context.Context, normalizedID string, relPath string) (info *api.Item, resp *http.Response, err error) { opts, _ := f.newOptsCallWithIDPath(normalizedID, relPath, true, "GET", "") @@ -1137,7 +1137,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -1156,7 +1156,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object into the container // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -1280,9 +1280,9 @@ func (f *Fs) waitForJob(ctx context.Context, location string, o *Object) error { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1387,9 +1387,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1843,7 +1843,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { diff --git a/backend/opendrive/opendrive.go b/backend/opendrive/opendrive.go index ac1a1c01d..35e1871c3 100644 --- a/backend/opendrive/opendrive.go +++ b/backend/opendrive/opendrive.go @@ -340,9 +340,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -404,9 +404,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -562,7 +562,7 @@ func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -599,7 +599,7 @@ func (f *Fs) readMetaDataForFolderID(ctx context.Context, id string) (info *Fold // Put the object into the bucket // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -829,7 +829,6 @@ func (o *Object) Size() int64 { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { diff --git a/backend/pcloud/pcloud.go b/backend/pcloud/pcloud.go index c558e4495..726d9ee8b 100644 --- a/backend/pcloud/pcloud.go +++ b/backend/pcloud/pcloud.go @@ -588,7 +588,7 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) ( // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -607,7 +607,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object into the container // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -681,9 +681,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -766,9 +766,9 @@ func (f *Fs) CleanUp(ctx context.Context) error { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1073,7 +1073,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1152,7 +1151,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/premiumizeme/premiumizeme.go b/backend/premiumizeme/premiumizeme.go index 3b02a3ac3..8f3aa1ce8 100644 --- a/backend/premiumizeme/premiumizeme.go +++ b/backend/premiumizeme/premiumizeme.go @@ -493,7 +493,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -512,7 +512,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -530,9 +530,9 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // PutUnchecked the object into the container // -// This will produce an error if the object already exists +// This will produce an error if the object already exists. // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -694,9 +694,9 @@ func (f *Fs) move(ctx context.Context, isFile bool, id, oldLeaf, newLeaf, oldDir // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -870,7 +870,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -917,7 +916,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/putio/fs.go b/backend/putio/fs.go index 3e2855b7d..cbcda547f 100644 --- a/backend/putio/fs.go +++ b/backend/putio/fs.go @@ -230,7 +230,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (o fs.Object, err error) { @@ -523,9 +523,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) (err error) { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -562,9 +562,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (o fs.Objec // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/putio/object.go b/backend/putio/object.go index 28caa5d1e..bd03982ca 100644 --- a/backend/putio/object.go +++ b/backend/putio/object.go @@ -261,7 +261,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the already existing object // -// Copy the reader into the object updating modTime and size +// Copy the reader into the object updating modTime and size. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/qingstor/qingstor.go b/backend/qingstor/qingstor.go index 9e9b0c6cc..cd4880358 100644 --- a/backend/qingstor/qingstor.go +++ b/backend/qingstor/qingstor.go @@ -431,9 +431,9 @@ func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options . // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -477,7 +477,7 @@ func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { // Return an Object from a path // -//If it can't be found it returns the error ErrorObjectNotFound. +// If it can't be found it returns the error ErrorObjectNotFound. func (f *Fs) newObjectWithInfo(remote string, info *qs.KeyType) (fs.Object, error) { o := &Object{ fs: f, diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 753e800f0..35745cbd5 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -2179,7 +2179,7 @@ var retryErrorCodes = []int{ 503, // Service Unavailable/Slow Down - "Reduce your request rate" } -//S3 is pretty resilient, and the built in retry handling is probably sufficient +// S3 is pretty resilient, and the built in retry handling is probably sufficient // as it should notice closed connections and timeouts which are the most likely // sort of failure modes func (f *Fs) shouldRetry(ctx context.Context, err error) (bool, error) { @@ -2671,7 +2671,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e // Return an Object from a path // -//If it can't be found it returns the error ErrorObjectNotFound. +// If it can't be found it returns the error ErrorObjectNotFound. func (f *Fs) newObjectWithInfo(ctx context.Context, remote string, info *s3.Object) (fs.Object, error) { o := &Object{ fs: f, @@ -3336,9 +3336,9 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dst // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/seafile/seafile.go b/backend/seafile/seafile.go index ffae61a5a..00457676c 100644 --- a/backend/seafile/seafile.go +++ b/backend/seafile/seafile.go @@ -671,9 +671,9 @@ func (f *Fs) ListR(ctx context.Context, dir string, callback fs.ListRCallback) e // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // If it isn't possible then return fs.ErrorCantCopy func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { @@ -722,9 +722,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // If it isn't possible then return fs.ErrorCantMove func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { diff --git a/backend/sharefile/sharefile.go b/backend/sharefile/sharefile.go index e6add47c2..acb5d65c8 100644 --- a/backend/sharefile/sharefile.go +++ b/backend/sharefile/sharefile.go @@ -741,7 +741,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -760,7 +760,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -783,9 +783,9 @@ func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, opt // PutUnchecked the object into the container // -// This will produce an error if the object already exists +// This will produce an error if the object already exists. // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -973,9 +973,9 @@ func (f *Fs) move(ctx context.Context, isFile bool, id, oldLeaf, newLeaf, oldDir // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1043,9 +1043,9 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1256,7 +1256,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1324,7 +1323,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/storj/fs.go b/backend/storj/fs.go index 95146edbf..b39e0b25d 100644 --- a/backend/storj/fs.go +++ b/backend/storj/fs.go @@ -683,9 +683,9 @@ func newPrefix(prefix string) string { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/sugarsync/sugarsync.go b/backend/sugarsync/sugarsync.go index 2041bdc05..7078de975 100644 --- a/backend/sugarsync/sugarsync.go +++ b/backend/sugarsync/sugarsync.go @@ -713,7 +713,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e // Creates from the parameters passed in a half finished Object which // must have setMetaData called on it // -// Returns the object, leaf, directoryID and error +// Returns the object, leaf, directoryID and error. // // Used to create new objects func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, size int64) (o *Object, leaf string, directoryID string, err error) { @@ -732,7 +732,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, modTime time.Time, // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -755,9 +755,9 @@ func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, opt // PutUnchecked the object into the container // -// This will produce an error if the object already exists +// This will produce an error if the object already exists. // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -852,9 +852,9 @@ func (f *Fs) Precision() time.Duration { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -985,9 +985,9 @@ func (f *Fs) moveDir(ctx context.Context, id, leaf, directoryID string) (err err // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1156,7 +1156,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1229,7 +1228,7 @@ func (f *Fs) createFile(ctx context.Context, pathID, leaf, mimeType string) (new // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/swift/swift.go b/backend/swift/swift.go index e4bae345e..bea898bda 100644 --- a/backend/swift/swift.go +++ b/backend/swift/swift.go @@ -790,7 +790,7 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) { // Put the object into the container // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -902,9 +902,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1019,7 +1019,7 @@ func copyLargeObject(ctx context.Context, f *Fs, src *Object, dstContainer strin return err } -//remove copied segments when copy process failed +// remove copied segments when copy process failed func handleCopyFail(ctx context.Context, f *Fs, segmentsContainer string, segments []string, err error) { fs.Debugf(f, "handle copy segment fail") if err == nil { @@ -1140,10 +1140,11 @@ func (o *Object) Size() int64 { // decodeMetaData sets the metadata in the object from a swift.Object // // Sets -// o.lastModified -// o.size -// o.md5 -// o.contentType +// +// o.lastModified +// o.size +// o.md5 +// o.contentType func (o *Object) decodeMetaData(info *swift.Object) (err error) { o.lastModified = info.LastModified o.size = info.Bytes @@ -1184,7 +1185,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { diff --git a/backend/union/union.go b/backend/union/union.go index 0e894a50b..8bcbf66c9 100644 --- a/backend/union/union.go +++ b/backend/union/union.go @@ -213,9 +213,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -253,9 +253,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // diff --git a/backend/uptobox/uptobox.go b/backend/uptobox/uptobox.go index 88faefce4..6bc5bd823 100644 --- a/backend/uptobox/uptobox.go +++ b/backend/uptobox/uptobox.go @@ -991,7 +991,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the already existing object // -// Copy the reader into the object updating modTime and size +// Copy the reader into the object updating modTime and size. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { diff --git a/backend/webdav/api/types.go b/backend/webdav/api/types.go index 44bdc7e27..7d36f058a 100644 --- a/backend/webdav/api/types.go +++ b/backend/webdav/api/types.go @@ -37,27 +37,29 @@ type Response struct { // This is a lazy way of decoding the multiple in the // response. // -// The response might look like this +// The response might look like this. // // -// /remote.php/webdav/Nextcloud%20Manual.pdf -// -// -// Tue, 19 Dec 2017 22:02:36 GMT -// 4143665 -// -// "048d7be4437ff7deeae94db50ff3e209" -// application/pdf -// -// HTTP/1.1 200 OK -// -// -// -// -// -// -// HTTP/1.1 404 Not Found -// +// +// /remote.php/webdav/Nextcloud%20Manual.pdf +// +// +// Tue, 19 Dec 2017 22:02:36 GMT +// 4143665 +// +// "048d7be4437ff7deeae94db50ff3e209" +// application/pdf +// +// HTTP/1.1 200 OK +// +// +// +// +// +// +// HTTP/1.1 404 Not Found +// +// // // // So we elide the array of and within that the array of @@ -127,8 +129,10 @@ type PropValue struct { // Error is used to describe webdav errors // // -// Sabre\DAV\Exception\NotFound -// File with name Photo could not be located +// +// Sabre\DAV\Exception\NotFound +// File with name Photo could not be located +// // type Error struct { Exception string `xml:"exception,omitempty"` @@ -214,16 +218,18 @@ func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { // Quota is used to read the bytes used and available // // -// -// /remote.php/webdav/ -// -// -// -3 -// 376461895 -// -// HTTP/1.1 200 OK -// -// +// +// +// /remote.php/webdav/ +// +// +// -3 +// 376461895 +// +// HTTP/1.1 200 OK +// +// +// // type Quota struct { Available string `xml:"DAV: response>propstat>prop>quota-available-bytes"` diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index d663ac0bf..ff5595f1b 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -800,7 +800,7 @@ func (f *Fs) createObject(remote string, modTime time.Time, size int64) (o *Obje // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -975,9 +975,9 @@ func (f *Fs) Precision() time.Duration { // Copy or Move src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1029,9 +1029,9 @@ func (f *Fs) copyOrMove(ctx context.Context, src fs.Object, remote string, metho // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1051,9 +1051,9 @@ func (f *Fs) Purge(ctx context.Context, dir string) error { // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1291,7 +1291,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/backend/yandex/api/types.go b/backend/yandex/api/types.go index 7e346b1ff..78d4c6850 100644 --- a/backend/yandex/api/types.go +++ b/backend/yandex/api/types.go @@ -20,7 +20,7 @@ type ResourceInfoRequestOptions struct { Fields []string } -//ResourceInfoResponse struct is returned by the API for metadata requests. +// ResourceInfoResponse struct is returned by the API for metadata requests. type ResourceInfoResponse struct { PublicKey string `json:"public_key"` Name string `json:"name"` @@ -61,7 +61,7 @@ type AsyncStatus struct { Status string `json:"status"` } -//CustomPropertyResponse struct we send and is returned by the API for CustomProperty request. +// CustomPropertyResponse struct we send and is returned by the API for CustomProperty request. type CustomPropertyResponse struct { CustomProperties map[string]interface{} `json:"custom_properties"` } diff --git a/backend/yandex/yandex.go b/backend/yandex/yandex.go index 7f0ddc5d8..3d5bf53cc 100644 --- a/backend/yandex/yandex.go +++ b/backend/yandex/yandex.go @@ -30,7 +30,7 @@ import ( "golang.org/x/oauth2" ) -//oAuth +// oAuth const ( rcloneClientID = "ac39b43b9eba4cae8ffb788c06d816a8" rcloneEncryptedClientSecret = "EfyyNZ3YUEwXM5yAhi72G9YwKn2mkFrYwJNS7cY0TJAhFlX9K-uJFbGlpO-RYjrJ" @@ -442,7 +442,7 @@ func (f *Fs) createObject(remote string, modTime time.Time, size int64) (o *Obje // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -693,9 +693,9 @@ func (f *Fs) copyOrMove(ctx context.Context, method, src, dst string, overwrite // Copy src to this remote using server-side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -723,9 +723,9 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, // Move src to this remote using server-side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1109,7 +1109,7 @@ func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeT // Update the already existing object // -// Copy the reader into the object updating modTime and size +// Copy the reader into the object updating modTime and size. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error { diff --git a/backend/zoho/zoho.go b/backend/zoho/zoho.go index 6175be3c5..167fa03ea 100644 --- a/backend/zoho/zoho.go +++ b/backend/zoho/zoho.go @@ -644,7 +644,7 @@ func (f *Fs) createObject(ctx context.Context, remote string, size int64, modTim // Put the object // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -714,9 +714,9 @@ func (f *Fs) upload(ctx context.Context, name string, parent string, size int64, // PutUnchecked the object into the container // -// This will produce an error if the object already exists +// This will produce an error if the object already exists. // -// Copy the reader in to the new object which is returned +// Copy the reader in to the new object which is returned. // // The new object may have been created if an error is returned func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) { @@ -857,9 +857,9 @@ func (f *Fs) rename(ctx context.Context, id, name string) (item *api.Item, err e // Copy src to this remote using server side copy operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -960,9 +960,9 @@ func (f *Fs) move(ctx context.Context, srcID, parentID string) (item *api.Item, // Move src to this remote using server side move operations. // -// This is stored with the remote path given +// This is stored with the remote path given. // -// It returns the destination Object and a possible error +// It returns the destination Object and a possible error. // // Will only be called if src.Fs().Name() == f.Name() // @@ -1152,7 +1152,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) { // ModTime returns the modification time of the object // -// // It attempts to read the objects mtime and if that isn't present the // LastModified returned in the http headers func (o *Object) ModTime(ctx context.Context) time.Time { @@ -1236,7 +1235,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read // Update the object with the contents of the io.Reader, modTime and size // -// If existing is set then it updates the object rather than creating a new one +// If existing is set then it updates the object rather than creating a new one. // // The new object may have been created if an error is returned func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) { diff --git a/cmd/bisync/bisync_test.go b/cmd/bisync/bisync_test.go index 52417b490..758d786ea 100644 --- a/cmd/bisync/bisync_test.go +++ b/cmd/bisync/bisync_test.go @@ -56,7 +56,8 @@ const ( // logReplacements make modern test logs comparable with golden dir. // It is a string slice of even length with this structure: -// {`matching regular expression`, "mangled result string", ...} +// +// {`matching regular expression`, "mangled result string", ...} var logReplacements = []string{ // skip syslog facility markers `^(<[1-9]>)(INFO |ERROR |NOTICE|DEBUG ):(.*)$`, "$2:$3", diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 610823c64..066b927e8 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -24,8 +24,8 @@ const ListingHeader = "# bisync listing v1 from" // lineRegex and lineFormat define listing line format // -// flags <- size -> <- hash -> id <------------ modtime -----------> "<----- remote" -// - 3009805 md5:xxxxxx - 2006-01-02T15:04:05.000000000-0700 "12 - Wait.mp3" +// flags <- size -> <- hash -> id <------------ modtime -----------> "<----- remote" +// - 3009805 md5:xxxxxx - 2006-01-02T15:04:05.000000000-0700 "12 - Wait.mp3" // // flags: "-" for a file and "d" for a directory (reserved) // hash: "type:value" or "-" (example: "md5:378840336ab14afa9c6b8d887e68a340") diff --git a/cmd/cmount/mount_brew.go b/cmd/cmount/mount_brew.go index 26531ff7a..ec1b97881 100644 --- a/cmd/cmount/mount_brew.go +++ b/cmd/cmount/mount_brew.go @@ -8,7 +8,7 @@ package cmount import ( "errors" - + "github.com/rclone/rclone/cmd/mountlib" "github.com/rclone/rclone/vfs" ) diff --git a/cmd/cmount/mountpoint_windows.go b/cmd/cmount/mountpoint_windows.go index c58dbc0f3..5cd0aa1d0 100644 --- a/cmd/cmount/mountpoint_windows.go +++ b/cmd/cmount/mountpoint_windows.go @@ -4,9 +4,9 @@ package cmount import ( + "errors" "fmt" "os" - "errors" "path/filepath" "regexp" diff --git a/cmd/serve/docker/options.go b/cmd/serve/docker/options.go index 3b6fb07f1..902665979 100644 --- a/cmd/serve/docker/options.go +++ b/cmd/serve/docker/options.go @@ -19,16 +19,16 @@ import ( // applyOptions configures volume from request options. // // There are 5 special options: -// - "remote" aka "fs" determines existing remote from config file -// with a path or on-the-fly remote using the ":backend:" syntax. -// It is usually named "remote" in documentation but can be aliased as -// "fs" to avoid confusion with the "remote" option of some backends. -// - "type" is equivalent to the ":backend:" syntax (optional). -// - "path" provides explicit on-remote path for "type" (optional). -// - "mount-type" can be "mount", "cmount" or "mount2", defaults to -// first found (optional). -// - "persist" is reserved for future to create remotes persisted -// in rclone.conf similar to rcd (optional). +// - "remote" aka "fs" determines existing remote from config file +// with a path or on-the-fly remote using the ":backend:" syntax. +// It is usually named "remote" in documentation but can be aliased as +// "fs" to avoid confusion with the "remote" option of some backends. +// - "type" is equivalent to the ":backend:" syntax (optional). +// - "path" provides explicit on-remote path for "type" (optional). +// - "mount-type" can be "mount", "cmount" or "mount2", defaults to +// first found (optional). +// - "persist" is reserved for future to create remotes persisted +// in rclone.conf similar to rcd (optional). // // Unlike rcd we use the flat naming scheme for mount, vfs and backend // options without substructures. Dashes, underscores and mixed case diff --git a/cmd/serve/ftp/ftp.go b/cmd/serve/ftp/ftp.go index 7ed96e3c0..11753e42f 100644 --- a/cmd/serve/ftp/ftp.go +++ b/cmd/serve/ftp/ftp.go @@ -185,26 +185,27 @@ func (s *server) serve() error { } // close stops the ftp server +// //lint:ignore U1000 unused when not building linux func (s *server) close() error { fs.Logf(s.f, "Stopping FTP on %s", s.srv.Hostname+":"+strconv.Itoa(s.srv.Port)) return s.srv.Shutdown() } -//Logger ftp logger output formatted message +// Logger ftp logger output formatted message type Logger struct{} -//Print log simple text message +// Print log simple text message func (l *Logger) Print(sessionID string, message interface{}) { fs.Infof(sessionID, "%s", message) } -//Printf log formatted text message +// Printf log formatted text message func (l *Logger) Printf(sessionID string, format string, v ...interface{}) { fs.Infof(sessionID, format, v...) } -//PrintCommand log formatted command execution +// PrintCommand log formatted command execution func (l *Logger) PrintCommand(sessionID string, command string, params string) { if command == "PASS" { fs.Infof(sessionID, "> PASS ****") @@ -213,7 +214,7 @@ func (l *Logger) PrintCommand(sessionID string, command string, params string) { } } -//PrintResponse log responses +// PrintResponse log responses func (l *Logger) PrintResponse(sessionID string, code int, message string) { fs.Infof(sessionID, "< %d %s", code, message) } @@ -237,7 +238,7 @@ func (s *server) NewDriver() (ftp.Driver, error) { return d, nil } -//Driver implementation of ftp server +// Driver implementation of ftp server type Driver struct { s *server vfs *vfs.VFS @@ -265,7 +266,7 @@ func (d *Driver) CheckPasswd(user, pass string) (ok bool, err error) { return true, nil } -//Stat get information on file or folder +// Stat get information on file or folder func (d *Driver) Stat(path string) (fi ftp.FileInfo, err error) { defer log.Trace(path, "")("fi=%+v, err = %v", &fi, &err) n, err := d.vfs.Stat(path) @@ -275,7 +276,7 @@ func (d *Driver) Stat(path string) (fi ftp.FileInfo, err error) { return &FileInfo{n, n.Mode(), d.vfs.Opt.UID, d.vfs.Opt.GID}, err } -//ChangeDir move current folder +// ChangeDir move current folder func (d *Driver) ChangeDir(path string) (err error) { d.lock.Lock() defer d.lock.Unlock() @@ -290,7 +291,7 @@ func (d *Driver) ChangeDir(path string) (err error) { return nil } -//ListDir list content of a folder +// ListDir list content of a folder func (d *Driver) ListDir(path string, callback func(ftp.FileInfo) error) (err error) { d.lock.Lock() defer d.lock.Unlock() @@ -326,7 +327,7 @@ func (d *Driver) ListDir(path string, callback func(ftp.FileInfo) error) (err er return nil } -//DeleteDir delete a folder and his content +// DeleteDir delete a folder and his content func (d *Driver) DeleteDir(path string) (err error) { d.lock.Lock() defer d.lock.Unlock() @@ -345,7 +346,7 @@ func (d *Driver) DeleteDir(path string) (err error) { return nil } -//DeleteFile delete a file +// DeleteFile delete a file func (d *Driver) DeleteFile(path string) (err error) { d.lock.Lock() defer d.lock.Unlock() @@ -364,7 +365,7 @@ func (d *Driver) DeleteFile(path string) (err error) { return nil } -//Rename rename a file or folder +// Rename rename a file or folder func (d *Driver) Rename(oldName, newName string) (err error) { d.lock.Lock() defer d.lock.Unlock() @@ -372,7 +373,7 @@ func (d *Driver) Rename(oldName, newName string) (err error) { return d.vfs.Rename(oldName, newName) } -//MakeDir create a folder +// MakeDir create a folder func (d *Driver) MakeDir(path string) (err error) { d.lock.Lock() defer d.lock.Unlock() @@ -385,7 +386,7 @@ func (d *Driver) MakeDir(path string) (err error) { return err } -//GetFile download a file +// GetFile download a file func (d *Driver) GetFile(path string, offset int64) (size int64, fr io.ReadCloser, err error) { d.lock.Lock() defer d.lock.Unlock() @@ -417,7 +418,7 @@ func (d *Driver) GetFile(path string, offset int64) (size int64, fr io.ReadClose return node.Size(), handle, nil } -//PutFile upload a file +// PutFile upload a file func (d *Driver) PutFile(path string, data io.Reader, appendData bool) (n int64, err error) { d.lock.Lock() defer d.lock.Unlock() @@ -479,7 +480,7 @@ func (d *Driver) PutFile(path string, data io.Reader, appendData bool) (n int64, return bytes, nil } -//FileInfo struct to hold file info for ftp server +// FileInfo struct to hold file info for ftp server type FileInfo struct { os.FileInfo @@ -488,12 +489,12 @@ type FileInfo struct { group uint32 } -//Mode return mode of file. +// Mode return mode of file. func (f *FileInfo) Mode() os.FileMode { return f.mode } -//Owner return owner of file. Try to find the username if possible +// Owner return owner of file. Try to find the username if possible func (f *FileInfo) Owner() string { str := fmt.Sprint(f.owner) u, err := user.LookupId(str) @@ -503,7 +504,7 @@ func (f *FileInfo) Owner() string { return u.Username } -//Group return group of file. Try to find the group name if possible +// Group return group of file. Try to find the group name if possible func (f *FileInfo) Group() string { str := fmt.Sprint(f.group) g, err := user.LookupGroupId(str) diff --git a/cmdtest/cmdtest.go b/cmdtest/cmdtest.go index 663178a1d..06a87ebab 100644 --- a/cmdtest/cmdtest.go +++ b/cmdtest/cmdtest.go @@ -2,7 +2,6 @@ // // The interface is used to perform end-to-end test of // commands, flags, environment variables etc. -// package cmdtest // The rest of this file is a 1:1 copy from rclone.go diff --git a/fs/bwtimetable.go b/fs/bwtimetable.go index 5cf76ee26..3361fd61f 100644 --- a/fs/bwtimetable.go +++ b/fs/bwtimetable.go @@ -208,7 +208,7 @@ func (x *BwTimetable) Set(s string) error { return nil } -// Difference in minutes between lateDayOfWeekHHMM and earlyDayOfWeekHHMM +// Difference in minutes between lateDayOfWeekHHMM and earlyDayOfWeekHHMM func timeDiff(lateDayOfWeekHHMM int, earlyDayOfWeekHHMM int) int { lateTimeMinutes := (lateDayOfWeekHHMM / 10000) * 24 * 60 diff --git a/fs/chunksize/chunksize.go b/fs/chunksize/chunksize.go index ab171f07d..5ecf1d5f3 100644 --- a/fs/chunksize/chunksize.go +++ b/fs/chunksize/chunksize.go @@ -6,14 +6,14 @@ import ( ) /* - Calculator calculates the minimum chunk size needed to fit within the maximum number of parts, rounded up to the nearest fs.Mebi +Calculator calculates the minimum chunk size needed to fit within the maximum number of parts, rounded up to the nearest fs.Mebi - For most backends, (chunk_size) * (concurrent_upload_routines) memory will be required so we want to use the smallest - possible chunk size that's going to allow the upload to proceed. Rounding up to the nearest fs.Mebi on the assumption - that some backends may only allow integer type parameters when specifying the chunk size. +For most backends, (chunk_size) * (concurrent_upload_routines) memory will be required so we want to use the smallest +possible chunk size that's going to allow the upload to proceed. Rounding up to the nearest fs.Mebi on the assumption +that some backends may only allow integer type parameters when specifying the chunk size. - Returns the default chunk size if it is sufficiently large enough to support the given file size otherwise returns the - smallest chunk size necessary to allow the upload to proceed. +Returns the default chunk size if it is sufficiently large enough to support the given file size otherwise returns the +smallest chunk size necessary to allow the upload to proceed. */ func Calculator(objInfo fs.ObjectInfo, maxParts int, defaultChunkSize fs.SizeSuffix) fs.SizeSuffix { fileSize := fs.SizeSuffix(objInfo.Size()) diff --git a/fs/config/authorize.go b/fs/config/authorize.go index fbfea2e0c..99aa2c947 100644 --- a/fs/config/authorize.go +++ b/fs/config/authorize.go @@ -12,9 +12,9 @@ import ( // // It expects 1, 2 or 3 arguments // -// rclone authorize "fs name" -// rclone authorize "fs name" "base64 encoded JSON blob" -// rclone authorize "fs name" "client id" "client secret" +// rclone authorize "fs name" +// rclone authorize "fs name" "base64 encoded JSON blob" +// rclone authorize "fs name" "client id" "client secret" func Authorize(ctx context.Context, args []string, noAutoBrowser bool) error { ctx = suppressConfirm(ctx) ctx = fs.ConfigOAuthOnly(ctx) diff --git a/fs/filter/filter.go b/fs/filter/filter.go index 741580fff..6f4ba9d5a 100644 --- a/fs/filter/filter.go +++ b/fs/filter/filter.go @@ -301,9 +301,9 @@ func (f *Filter) Add(Include bool, glob string) error { // // These are // -// + glob // - glob -// ! +// - glob +// ! // // '+' includes the glob, '-' excludes it and '!' resets the filter list // diff --git a/fs/log.go b/fs/log.go index 8328b9106..3f6fe21a7 100644 --- a/fs/log.go +++ b/fs/log.go @@ -15,14 +15,14 @@ type LogLevel byte // Log levels. These are the syslog levels of which we only use a // subset. // -// LOG_EMERG system is unusable -// LOG_ALERT action must be taken immediately -// LOG_CRIT critical conditions -// LOG_ERR error conditions -// LOG_WARNING warning conditions -// LOG_NOTICE normal, but significant, condition -// LOG_INFO informational message -// LOG_DEBUG debug-level message +// LOG_EMERG system is unusable +// LOG_ALERT action must be taken immediately +// LOG_CRIT critical conditions +// LOG_ERR error conditions +// LOG_WARNING warning conditions +// LOG_NOTICE normal, but significant, condition +// LOG_INFO informational message +// LOG_DEBUG debug-level message const ( LogLevelEmergency LogLevel = iota LogLevelAlert diff --git a/fs/mount_helper.go b/fs/mount_helper.go index f45b85895..5239ff9a5 100644 --- a/fs/mount_helper.go +++ b/fs/mount_helper.go @@ -169,7 +169,9 @@ func convertMountHelperArgs(origArgs []string) ([]string, error) { // parseHelperOptionString deconstructs the -o value into slice of options // in a way similar to connection strings. // Example: -// param1=value,param2="qvalue",param3='item1,item2',param4="a ""b"" 'c'" +// +// param1=value,param2="qvalue",param3='item1,item2',param4="a ""b"" 'c'" +// // An error may be returned if the remote name has invalid characters // or the parameters are invalid or the path is empty. // diff --git a/fs/open_options.go b/fs/open_options.go index 57daa132a..5dc3e32d4 100644 --- a/fs/open_options.go +++ b/fs/open_options.go @@ -40,10 +40,10 @@ type OpenOption interface { // // Examples: // -// RangeOption{Start: 0, End: 99} - fetch the first 100 bytes -// RangeOption{Start: 100, End: 199} - fetch the second 100 bytes -// RangeOption{Start: 100, End: -1} - fetch bytes from offset 100 to the end -// RangeOption{Start: -1, End: 100} - fetch the last 100 bytes +// RangeOption{Start: 0, End: 99} - fetch the first 100 bytes +// RangeOption{Start: 100, End: 199} - fetch the second 100 bytes +// RangeOption{Start: 100, End: -1} - fetch bytes from offset 100 to the end +// RangeOption{Start: -1, End: 100} - fetch the last 100 bytes // // A RangeOption implements a single byte-range-spec from // https://tools.ietf.org/html/rfc7233#section-2.1 diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 081ceb7a7..2bfddd07d 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -44,7 +44,7 @@ import ( // CheckHashes checks the two files to see if they have common // known hash types and compares them // -// Returns +// Returns. // // equal - which is equality of the hashes // @@ -911,7 +911,7 @@ var SyncPrintf = func(format string, a ...interface{}) { // Synchronized fmt.Fprintf // -// Ignores errors from Fprintf +// Ignores errors from Fprintf. // // Updated to print to terminal if no writer is defined // This special behavior is used to allow easier replacement of the print to terminal code by progress @@ -981,7 +981,7 @@ func CountStringField(count int64, humanReadable bool, rawWidth int) string { // List the Fs to the supplied writer // -// Shows size and path - obeys includes and excludes +// Shows size and path - obeys includes and excludes. // // Lists in parallel which may get them out of order func List(ctx context.Context, f fs.Fs, w io.Writer) error { @@ -993,7 +993,7 @@ func List(ctx context.Context, f fs.Fs, w io.Writer) error { // ListLong lists the Fs to the supplied writer // -// Shows size, mod time and path - obeys includes and excludes +// Shows size, mod time and path - obeys includes and excludes. // // Lists in parallel which may get them out of order func ListLong(ctx context.Context, f fs.Fs, w io.Writer) error { diff --git a/fs/operations/rc_test.go b/fs/operations/rc_test.go index 8b4cf1bb6..16b3267f4 100644 --- a/fs/operations/rc_test.go +++ b/fs/operations/rc_test.go @@ -499,8 +499,7 @@ func TestRcFsInfo(t *testing.T) { } -//operations/uploadfile : Tests if upload file succeeds -// +// operations/uploadfile : Tests if upload file succeeds func TestUploadFile(t *testing.T) { r, call := rcNewRun(t, "operations/uploadfile") defer r.Finalise() diff --git a/fs/operations/reopen.go b/fs/operations/reopen.go index e0f38cfcb..9bfb1508f 100644 --- a/fs/operations/reopen.go +++ b/fs/operations/reopen.go @@ -31,7 +31,7 @@ var ( // NewReOpen makes a handle which will reopen itself and seek to where it was on errors // -// If hashOption is set this will be applied when reading from the start +// If hashOption is set this will be applied when reading from the start. // // If rangeOption is set then this will applied when reading from the // start, and updated on retries. diff --git a/fs/rc/params.go b/fs/rc/params.go index a2eabb6f4..b6d5545f1 100644 --- a/fs/rc/params.go +++ b/fs/rc/params.go @@ -48,7 +48,6 @@ func NotErrParamNotFound(err error) bool { // ErrParamInvalid - this is returned from the Get* functions if the // parameter is invalid. // -// // Returning an error of this type from an rc.Func will cause the http // method to return http.StatusBadRequest type ErrParamInvalid struct { diff --git a/fs/rc/webgui/plugins.go b/fs/rc/webgui/plugins.go index 8f212be58..a6730aacb 100644 --- a/fs/rc/webgui/plugins.go +++ b/fs/rc/webgui/plugins.go @@ -227,12 +227,12 @@ func (p *Plugins) GetPluginByName(name string) (out *PackageJSON, err error) { } // getAuthorRepoBranchGithub gives author, repoName and branch from a github.com url +// // url examples: // https://github.com/rclone/rclone-webui-react/ // http://github.com/rclone/rclone-webui-react // https://github.com/rclone/rclone-webui-react/tree/caman-js -// github.com/rclone/rclone-webui-react -// +// github.com/rclone/rclone-webui-react func getAuthorRepoBranchGithub(url string) (author string, repoName string, branch string, err error) { repoURL := url repoURL = strings.Replace(repoURL, "https://", "", 1) diff --git a/fs/registry.go b/fs/registry.go index ca2c3d976..33dba915b 100644 --- a/fs/registry.go +++ b/fs/registry.go @@ -130,16 +130,16 @@ const ( // Option is describes an option for the config wizard // -// This also describes command line options and environment variables +// This also describes command line options and environment variables. // // To create a multiple-choice option, specify the possible values // in the Examples property. Whether the option's value is required // to be one of these depends on other properties: -// - Default is to allow any value, either from specified examples, -// or any other value. To restrict exclusively to the specified -// examples, also set Exclusive=true. -// - If empty string should not be allowed then set Required=true, -// and do not set Default. +// - Default is to allow any value, either from specified examples, +// or any other value. To restrict exclusively to the specified +// examples, also set Exclusive=true. +// - If empty string should not be allowed then set Required=true, +// and do not set Default. type Option struct { Name string // name of the option in snake_case Help string // help, start with a single sentence on a single line that will be extracted for command line help @@ -292,7 +292,7 @@ func Find(name string) (*RegInfo, error) { // MustFind looks for an Info object for the type name passed in // -// Services are looked up in the config file +// Services are looked up in the config file. // // Exits with a fatal error if not found func MustFind(name string) *RegInfo { diff --git a/fs/sync/sync.go b/fs/sync/sync.go index 2c671cf72..9ef36da10 100644 --- a/fs/sync/sync.go +++ b/fs/sync/sync.go @@ -301,9 +301,10 @@ func (s *syncCopyMove) processError(err error) { } // Returns the current error (if any) in the order of precedence -// fatalErr -// normal error -// noRetryErr +// +// fatalErr +// normal error +// noRetryErr func (s *syncCopyMove) currentError() error { s.errorMu.Lock() defer s.errorMu.Unlock() @@ -837,7 +838,7 @@ var errorMaxDurationReached = fserrors.FatalError(errors.New("max transfer durat // // If Delete is true then it deletes any files in fdst that aren't in fsrc // -// If DoMove is true then files will be moved instead of copied +// If DoMove is true then files will be moved instead of copied. // // dir is the start directory, "" for root func (s *syncCopyMove) run() error { @@ -1083,7 +1084,7 @@ func (s *syncCopyMove) Match(ctx context.Context, dst, src fs.DirEntry) (recurse // // If Delete is true then it deletes any files in fdst that aren't in fsrc // -// If DoMove is true then files will be moved instead of copied +// If DoMove is true then files will be moved instead of copied. // // dir is the start directory, "" for root func runSyncCopyMove(ctx context.Context, fdst, fsrc fs.Fs, deleteMode fs.DeleteMode, DoMove bool, deleteEmptySrcDirs bool, copyEmptySrcDirs bool) error { diff --git a/fs/walk/walk.go b/fs/walk/walk.go index b6ca99c32..f63350a47 100644 --- a/fs/walk/walk.go +++ b/fs/walk/walk.go @@ -50,7 +50,7 @@ type Func func(path string, entries fs.DirEntries, err error) error // Note that fn will not be called concurrently whereas the directory // listing will proceed concurrently. // -// Parent directories are always listed before their children +// Parent directories are always listed before their children. // // This is implemented by WalkR if Config.UseListR is true // and f supports it and level > 1, or WalkN otherwise. diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 97e44ea1a..5bf90d840 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -189,7 +189,7 @@ var ( // PutTestContentsMetadata puts file with given contents to the remote and checks it but unlike TestPutLarge doesn't remove // -// It uploads the object with the mimeType and metadata passed in if set +// It uploads the object with the mimeType and metadata passed in if set. // // It returns the object which will have been checked if check is set func PutTestContentsMetadata(ctx context.Context, t *testing.T, f fs.Fs, file *fstest.Item, contents string, check bool, mimeType string, metadata fs.Metadata) fs.Object { diff --git a/fstest/test_all/test_all.go b/fstest/test_all/test_all.go index 2a3b9421d..1bf0311e0 100644 --- a/fstest/test_all/test_all.go +++ b/fstest/test_all/test_all.go @@ -2,7 +2,6 @@ // need integration testing. // // See the `test` target in the Makefile. -// package main /* FIXME diff --git a/lib/atexit/atexit.go b/lib/atexit/atexit.go index bcc851847..363d3267b 100644 --- a/lib/atexit/atexit.go +++ b/lib/atexit/atexit.go @@ -111,7 +111,7 @@ func Run() { // // It should be used in a defer statement normally so // -// defer OnError(&err, cancelFunc)() +// defer OnError(&err, cancelFunc)() // // So cancelFunc will be run if the function exits with an error or // at exit. diff --git a/lib/bucket/bucket.go b/lib/bucket/bucket.go index f77887129..13217f0da 100644 --- a/lib/bucket/bucket.go +++ b/lib/bucket/bucket.go @@ -120,7 +120,7 @@ func (c *Cache) Create(bucket string, create CreateFn, exists ExistsFn) (err err // Remove the bucket with f if it exists // -// If f returns an error we assume the bucket was not removed +// If f returns an error we assume the bucket was not removed. // // If the bucket has already been deleted it returns ErrAlreadyDeleted func (c *Cache) Remove(bucket string, f func() error) error { diff --git a/lib/dircache/dircache.go b/lib/dircache/dircache.go index 05766335d..920215e08 100644 --- a/lib/dircache/dircache.go +++ b/lib/dircache/dircache.go @@ -192,7 +192,7 @@ func SplitPath(path string) (directory, leaf string) { // // Path shouldn't start or end with a / // -// If create is set it will make the directory if not found +// If create is set it will make the directory if not found. // // It will call FindRoot if it hasn't been called already func (dc *DirCache) FindDir(ctx context.Context, path string, create bool) (pathID string, err error) { @@ -282,7 +282,7 @@ func (dc *DirCache) FindPath(ctx context.Context, path string, create bool) (lea // If successful this changes the root of the cache from the true root // to the root specified by the path passed into New. // -// Resets the root directory +// Resets the root directory. // // If create is set it will make the directory if not found func (dc *DirCache) FindRoot(ctx context.Context, create bool) error { @@ -293,9 +293,9 @@ func (dc *DirCache) FindRoot(ctx context.Context, create bool) error { // _findRoot finds the root directory if not already found // -// Resets the root directory +// Resets the root directory. // -// If create is set it will make the directory if not found +// If create is set it will make the directory if not found. // // Call with mu held func (dc *DirCache) _findRoot(ctx context.Context, create bool) error { @@ -390,7 +390,7 @@ func (dc *DirCache) ResetRoot() { // It does all the checking, creates intermediate directories and // returns leafs and IDs ready for the move. // -// This returns +// This returns: // // - srcID - ID of the source directory // - srcDirectoryID - ID of the parent of the source directory diff --git a/lib/encoder/os_windows.go b/lib/encoder/os_windows.go index 87b47b646..7e3c4dd87 100644 --- a/lib/encoder/os_windows.go +++ b/lib/encoder/os_windows.go @@ -6,19 +6,21 @@ package encoder // OS is the encoding used by the local backend for windows platforms // // List of replaced characters: -// < (less than) -> '<' // FULLWIDTH LESS-THAN SIGN -// > (greater than) -> '>' // FULLWIDTH GREATER-THAN SIGN -// : (colon) -> ':' // FULLWIDTH COLON -// " (double quote) -> '"' // FULLWIDTH QUOTATION MARK -// \ (backslash) -> '\' // FULLWIDTH REVERSE SOLIDUS -// | (vertical line) -> '|' // FULLWIDTH VERTICAL LINE -// ? (question mark) -> '?' // FULLWIDTH QUESTION MARK -// * (asterisk) -> '*' // FULLWIDTH ASTERISK +// +// < (less than) -> '<' // FULLWIDTH LESS-THAN SIGN +// > (greater than) -> '>' // FULLWIDTH GREATER-THAN SIGN +// : (colon) -> ':' // FULLWIDTH COLON +// " (double quote) -> '"' // FULLWIDTH QUOTATION MARK +// \ (backslash) -> '\' // FULLWIDTH REVERSE SOLIDUS +// | (vertical line) -> '|' // FULLWIDTH VERTICAL LINE +// ? (question mark) -> '?' // FULLWIDTH QUESTION MARK +// * (asterisk) -> '*' // FULLWIDTH ASTERISK // // Additionally names can't end with a period (.) or space ( ). // List of replaced characters: -// . (period) -> '.' // FULLWIDTH FULL STOP -// (space) -> '␠' // SYMBOL FOR SPACE +// +// . (period) -> '.' // FULLWIDTH FULL STOP +// (space) -> '␠' // SYMBOL FOR SPACE // // Also encode invalid UTF-8 bytes as Go can't convert them to UTF-16. // diff --git a/lib/encoder/standard.go b/lib/encoder/standard.go index 439437c79..94180de1a 100644 --- a/lib/encoder/standard.go +++ b/lib/encoder/standard.go @@ -3,8 +3,9 @@ package encoder // Standard defines the encoding that is used for paths in- and output by rclone. // // List of replaced characters: -// (0x00) -> '␀' // SYMBOL FOR NULL -// / (slash) -> '/' // FULLWIDTH SOLIDUS +// +// (0x00) -> '␀' // SYMBOL FOR NULL +// / (slash) -> '/' // FULLWIDTH SOLIDUS const Standard = (EncodeZero | EncodeSlash | EncodeCtl | diff --git a/lib/errors/errors.go b/lib/errors/errors.go index 2d9c6b93f..68238521e 100644 --- a/lib/errors/errors.go +++ b/lib/errors/errors.go @@ -14,10 +14,11 @@ type WalkFunc func(error) bool // is stopped and no further calls will be made. // // The next error in the chain is determined by the following rules: -// the return value of this method is used. -// - If the current error has a `Unwrap() error` method (golang.org/x/xerrors), -// the return value of this method is used. -// - Common errors in the Go runtime that contain an Err field will use this value. +// +// the return value of this method is used. +// - If the current error has a `Unwrap() error` method (golang.org/x/xerrors), +// the return value of this method is used. +// - Common errors in the Go runtime that contain an Err field will use this value. func Walk(err error, f WalkFunc) { for prev := err; err != nil; prev = err { if f(err) { diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go index 2033ac5f5..350fe1671 100644 --- a/lib/oauthutil/oauthutil.go +++ b/lib/oauthutil/oauthutil.go @@ -433,10 +433,10 @@ func ConfigOut(state string, oAuth *Options) (*fs.ConfigOut, error) { // // This is called with a state which has pushed on it // -// state prefixed with "*oauth" -// state for oauth to return to -// state that returned the OAuth when we wish to recall it -// value that returned the OAuth +// state prefixed with "*oauth" +// state for oauth to return to +// state that returned the OAuth when we wish to recall it +// value that returned the OAuth func ConfigOAuth(ctx context.Context, name string, m configmap.Mapper, ri *fs.RegInfo, in fs.ConfigIn) (*fs.ConfigOut, error) { stateParams, state := fs.StatePop(in.State) @@ -624,7 +624,7 @@ func fixRedirect(oauthConfig *oauth2.Config) *oauth2.Config { // configSetup does the initial creation of the token // -// If opt is nil it will use the default Options +// If opt is nil it will use the default Options. // // It will run an internal webserver to receive the results func configSetup(ctx context.Context, id, name string, m configmap.Mapper, oauthConfig *oauth2.Config, opt *Options) (string, error) { diff --git a/lib/pacer/pacer.go b/lib/pacer/pacer.go index 0257d70da..4b1cbb37b 100644 --- a/lib/pacer/pacer.go +++ b/lib/pacer/pacer.go @@ -148,7 +148,7 @@ func (p *Pacer) ModifyCalculator(f func(Calculator)) { // Start a call to the API // -// This must be called as a pair with endCall +// This must be called as a pair with endCall. // // This waits for the pacer token func (p *Pacer) beginCall() { diff --git a/lib/plugin/package.go b/lib/plugin/package.go index 72598680f..d962d713e 100644 --- a/lib/plugin/package.go +++ b/lib/plugin/package.go @@ -7,7 +7,7 @@ // To create a plugin, write the backend package like it was in-tree // but set the package name to "main". Then, build the plugin with // -// go build -buildmode=plugin -o librcloneplugin_NAME.so +// go build -buildmode=plugin -o librcloneplugin_NAME.so // // where NAME equals the plugin's fs.RegInfo.Name. package plugin diff --git a/lib/rest/rest.go b/lib/rest/rest.go index adf10925d..69bb1deff 100644 --- a/lib/rest/rest.go +++ b/lib/rest/rest.go @@ -407,7 +407,7 @@ func MultipartUpload(ctx context.Context, in io.Reader, params url.Values, conte // CallJSON runs Call and decodes the body as a JSON object into response (if not nil) // -// If request is not nil then it will be JSON encoded as the body of the request +// If request is not nil then it will be JSON encoded as the body of the request. // // If response is not nil then the response will be JSON decoded into // it and resp.Body will be closed. @@ -430,7 +430,7 @@ func (api *Client) CallJSON(ctx context.Context, opts *Opts, request interface{} // CallXML runs Call and decodes the body as an XML object into response (if not nil) // -// If request is not nil then it will be XML encoded as the body of the request +// If request is not nil then it will be XML encoded as the body of the request. // // If response is not nil then the response will be XML decoded into // it and resp.Body will be closed. @@ -438,7 +438,7 @@ func (api *Client) CallJSON(ctx context.Context, opts *Opts, request interface{} // If response is nil then the resp.Body will be closed only if // opts.NoResponse is set. // -// See CallJSON for a description of MultipartParams and related opts +// See CallJSON for a description of MultipartParams and related opts. // // It will return resp if at all possible, even if err is set func (api *Client) CallXML(ctx context.Context, opts *Opts, request interface{}, response interface{}) (resp *http.Response, err error) { diff --git a/librclone/gomobile/gomobile.go b/librclone/gomobile/gomobile.go index cc899e43c..ff3f451c2 100644 --- a/librclone/gomobile/gomobile.go +++ b/librclone/gomobile/gomobile.go @@ -22,8 +22,8 @@ func RcloneFinalize() { // RcloneRPCResult is returned from RcloneRPC // -// Output will be returned as a serialized JSON object -// Status is a HTTP status return (200=OK anything else fail) +// Output will be returned as a serialized JSON object +// Status is a HTTP status return (200=OK anything else fail) type RcloneRPCResult struct { Output string Status int diff --git a/librclone/librclone.go b/librclone/librclone.go index f90a7e413..ef92b6d8a 100644 --- a/librclone/librclone.go +++ b/librclone/librclone.go @@ -7,11 +7,11 @@ // // Build a shared library like this: // -// go build --buildmode=c-shared -o librclone.so github.com/rclone/rclone/librclone +// go build --buildmode=c-shared -o librclone.so github.com/rclone/rclone/librclone // // Build a static library like this: // -// go build --buildmode=c-archive -o librclone.a github.com/rclone/rclone/librclone +// go build --buildmode=c-archive -o librclone.a github.com/rclone/rclone/librclone // // Both the above commands will also generate `librclone.h` which should // be `#include`d in `C` programs wishing to use the library. @@ -59,8 +59,8 @@ func RcloneFinalize() { // RcloneRPCResult is returned from RcloneRPC // -// Output will be returned as a serialized JSON object -// Status is a HTTP status return (200=OK anything else fail) +// Output will be returned as a serialized JSON object +// Status is a HTTP status return (200=OK anything else fail) type RcloneRPCResult struct { //nolint:deadcode Output *C.char Status C.int @@ -70,10 +70,10 @@ type RcloneRPCResult struct { //nolint:deadcode // and the output is (output, status). This is an exported interface // to the rclone API as described in https://rclone.org/rc/ // -// method is a string, eg "operations/list" -// input should be a string with a serialized JSON object -// result.Output will be returned as a string with a serialized JSON object -// result.Status is a HTTP status return (200=OK anything else fail) +// method is a string, eg "operations/list" +// input should be a string with a serialized JSON object +// result.Output will be returned as a string with a serialized JSON object +// result.Status is a HTTP status return (200=OK anything else fail) // // All strings are UTF-8 encoded, on all platforms. // diff --git a/librclone/librclone/librclone.go b/librclone/librclone/librclone.go index 58e10f83b..5b29e4c59 100644 --- a/librclone/librclone/librclone.go +++ b/librclone/librclone/librclone.go @@ -72,7 +72,7 @@ func writeError(path string, in rc.Params, err error, status int) (string, int) // RPC runs a transaction over the RC // -// Calling an rc function using JSON to input parameters and output the resulted JSON +// Calling an rc function using JSON to input parameters and output the resulted JSON. // // operations/uploadfile and core/command are not supported as they need request or response object // modified from handlePost in rcserver.go diff --git a/vfs/dir.go b/vfs/dir.go index 004595b77..7f6830582 100644 --- a/vfs/dir.go +++ b/vfs/dir.go @@ -555,7 +555,7 @@ func (d *Dir) _newManageVirtuals() manageVirtuals { // This should be called for every entry added to the directory // -// It returns true if this entry should be skipped +// It returns true if this entry should be skipped. // // must be called with the Dir lock held func (mv manageVirtuals) add(d *Dir, name string) bool { diff --git a/vfs/file.go b/vfs/file.go index 4431c6cc5..4e59aee74 100644 --- a/vfs/file.go +++ b/vfs/file.go @@ -645,15 +645,15 @@ func (f *File) Fs() fs.Fs { // Open a file according to the flags provided // -// O_RDONLY open the file read-only. -// O_WRONLY open the file write-only. -// O_RDWR open the file read-write. +// O_RDONLY open the file read-only. +// O_WRONLY open the file write-only. +// O_RDWR open the file read-write. // -// O_APPEND append data to the file when writing. -// O_CREATE create a new file if none exists. -// O_EXCL used with O_CREATE, file must not exist -// O_SYNC open for synchronous I/O. -// O_TRUNC if possible, truncate file when opened +// O_APPEND append data to the file when writing. +// O_CREATE create a new file if none exists. +// O_EXCL used with O_CREATE, file must not exist +// O_SYNC open for synchronous I/O. +// O_TRUNC if possible, truncate file when opened // // We ignore O_SYNC and O_EXCL func (f *File) Open(flags int) (fd Handle, err error) { diff --git a/vfs/help.go b/vfs/help.go index 3bb809ca8..84ad2dc9d 100644 --- a/vfs/help.go +++ b/vfs/help.go @@ -7,7 +7,8 @@ import ( // Help contains text describing file and directory caching to add to // the command help. // Warning: "!" (sic) will be replaced by backticks below, -// but the pipe character "|" can be used as is. +// +// but the pipe character "|" can be used as is. var Help = strings.ReplaceAll(` ### VFS - Virtual File System diff --git a/vfs/read.go b/vfs/read.go index bfe4b2d5c..53d621a3c 100644 --- a/vfs/read.go +++ b/vfs/read.go @@ -215,7 +215,7 @@ func (fh *ReadFileHandle) ReadAt(p []byte, off int64) (n int, err error) { // This waits for *poff to equal off or aborts after the timeout. // -// Waits here potentially affect all seeks so need to keep them short +// Waits here potentially affect all seeks so need to keep them short. // // Call with fh.mu Locked func waitSequential(what string, remote string, cond *sync.Cond, maxWait time.Duration, poff *int64, off int64) { diff --git a/vfs/read_write.go b/vfs/read_write.go index a66ea051f..ead0f6b23 100644 --- a/vfs/read_write.go +++ b/vfs/read_write.go @@ -139,7 +139,7 @@ func (fh *RWFileHandle) updateSize() { // close the file handle returning EBADF if it has been // closed already. // -// Must be called with fh.mu held +// Must be called with fh.mu held. // // Note that we leave the file around in the cache on error conditions // to give the user a chance to recover it. diff --git a/vfs/vfscache/cache.go b/vfs/vfscache/cache.go index 9c0ec0bf0..164950388 100644 --- a/vfs/vfscache/cache.go +++ b/vfs/vfscache/cache.go @@ -339,7 +339,7 @@ func (c *Cache) get(name string) (item *Item, found bool) { // Item gets a cache item for name // -// To use it item.Open will need to be called +// To use it item.Open will need to be called. // // name should be a remote path not an osPath func (c *Cache) Item(name string) (item *Item) { diff --git a/vfs/vfscache/downloaders/downloaders.go b/vfs/vfscache/downloaders/downloaders.go index 42ca677fd..46018c7e1 100644 --- a/vfs/vfscache/downloaders/downloaders.go +++ b/vfs/vfscache/downloaders/downloaders.go @@ -137,8 +137,8 @@ func New(item Item, opt *vfscommon.Options, remote string, src fs.Object) (dls * // // It should be called with // -// n bytes downloaded -// err is error from download +// n bytes downloaded +// err is error from download // // call with lock held func (dls *Downloaders) _countErrors(n int64, err error) { diff --git a/vfs/vfscache/downloaders/downloaders_test.go b/vfs/vfscache/downloaders/downloaders_test.go index 462a06a61..fdbd942dc 100644 --- a/vfs/vfscache/downloaders/downloaders_test.go +++ b/vfs/vfscache/downloaders/downloaders_test.go @@ -53,7 +53,7 @@ func (item *testItem) FindMissing(r ranges.Range) (outr ranges.Range) { // WriteAtNoOverwrite writes b to the file, but will not overwrite // already present ranges. // -// This is used by the downloader to write bytes to the file +// This is used by the downloader to write bytes to the file. // // It returns n the total bytes processed and skipped the number of // bytes which were processed but not actually written to the file. diff --git a/vfs/vfscache/item.go b/vfs/vfscache/item.go index 5d606f21e..36355d981 100644 --- a/vfs/vfscache/item.go +++ b/vfs/vfscache/item.go @@ -286,7 +286,7 @@ func (item *Item) _truncate(size int64) (err error) { // Truncate the item to the current size, creating if necessary // -// This does not mark the object as dirty +// This does not mark the object as dirty. // // call with the lock held func (item *Item) _truncateToCurrentSize() (err error) { @@ -725,7 +725,7 @@ func (item *Item) Close(storeFn StoreFn) (err error) { // reload is called with valid items recovered from a cache reload. // -// If they are dirty then it makes sure they get uploaded +// If they are dirty then it makes sure they get uploaded. // // it is called before the cache has started so opens will be 0 and // metaDirty will be false. @@ -766,7 +766,7 @@ func (item *Item) reload(ctx context.Context) error { // If we have local modifications then they take precedence // over a change in the remote // -// It ensures the file is the correct size for the object +// It ensures the file is the correct size for the object. // // call with lock held func (item *Item) _checkObject(o fs.Object) error { @@ -1305,7 +1305,7 @@ func (item *Item) WriteAt(b []byte, off int64) (n int, err error) { // WriteAtNoOverwrite writes b to the file, but will not overwrite // already present ranges. // -// This is used by the downloader to write bytes to the file +// This is used by the downloader to write bytes to the file. // // It returns n the total bytes processed and skipped the number of // bytes which were processed but not actually written to the file. diff --git a/vfs/vfscache/writeback/writeback.go b/vfs/vfscache/writeback/writeback.go index 5f63f5461..b4ab6d39a 100644 --- a/vfs/vfscache/writeback/writeback.go +++ b/vfs/vfscache/writeback/writeback.go @@ -252,7 +252,7 @@ func (wb *WriteBack) SetID(pid *Handle) { // If id is 0 then a new item will always be created and the new // Handle will be returned. // -// Use SetID to create Handles in advance of calling Add +// Use SetID to create Handles in advance of calling Add. // // If modified is false then it it doesn't cancel a pending upload if // there is one as there is no need. diff --git a/vfs/vfstest/submount.go b/vfs/vfstest/submount.go index e405dd847..7c28de8a9 100644 --- a/vfs/vfstest/submount.go +++ b/vfs/vfstest/submount.go @@ -181,9 +181,12 @@ func startMount(mountFn mountlib.MountFn, useVFS bool, opts string) { // line to send to stdout with an exit flag. // // The format of the lines is -// command \t parameter (optional) +// +// command \t parameter (optional) +// // The response should be -// OK|ERR \t result (optional) +// +// OK|ERR \t result (optional) func doMountCommand(vfs *vfs.VFS, rx string) (tx string, exit bool) { command := strings.Split(rx, "\t") // log.Printf("doMountCommand: %q received", command)