mirror of
https://github.com/rclone/rclone.git
synced 2025-12-16 00:04:40 +00:00
build: reformat comments to pass go1.19 vet
See: https://go.dev/doc/go1.19#go-doc
This commit is contained in:
@@ -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 {
|
||||
|
||||
16
vfs/file.go
16
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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user