rclone/fs
Nick Craig-Wood 401cf81034 build: modernize Go usage
This commit modernizes Go usage. This was done with:

go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...

Then files needed to be `go fmt`ed and a few comments needed to be
restored.

The modernizations include replacing

- if/else conditional assignment by a call to the built-in min or max functions added in go1.21
- sort.Slice(x, func(i, j int) bool) { return s[i] < s[j] } by a call to slices.Sort(s), added in go1.21
- interface{} by the 'any' type added in go1.18
- append([]T(nil), s...) by slices.Clone(s) or slices.Concat(s), added in go1.21
- loop around an m[k]=v map update by a call to one of the Collect, Copy, Clone, or Insert functions from the maps package, added in go1.21
- []byte(fmt.Sprintf...) by fmt.Appendf(nil, ...), added in go1.19
- append(s[:i], s[i+1]...) by slices.Delete(s, i, i+1), added in go1.21
- a 3-clause for i := 0; i < n; i++ {} loop by for i := range n {}, added in go1.22
2025-02-28 11:31:14 +00:00
..
accounting build: modernize Go usage 2025-02-28 11:31:14 +00:00
asyncreader build: modernize Go usage 2025-02-28 11:31:14 +00:00
cache build: modernize Go usage 2025-02-28 11:31:14 +00:00
chunkedreader build: modernize Go usage 2025-02-28 11:31:14 +00:00
chunksize build: modernize Go usage 2025-02-28 11:31:14 +00:00
config build: modernize Go usage 2025-02-28 11:31:14 +00:00
dirtree build: modernize Go usage 2025-02-28 11:31:14 +00:00
driveletter build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
filter build: modernize Go usage 2025-02-28 11:31:14 +00:00
fserrors build: modernize Go usage 2025-02-28 11:31:14 +00:00
fshttp build: modernize Go usage 2025-02-28 11:31:14 +00:00
fspath build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
hash build: update logging statements to make json log work - fixes #6038 2024-09-06 17:04:18 +01:00
list fs/list: tweak directory listing assertions after allowing // names 2025-01-22 11:56:05 +00:00
log build: modernize Go usage 2025-02-28 11:31:14 +00:00
logger build: update all dependencies and fix deprecations 2025-02-26 18:00:58 +00:00
march build: modernize Go usage 2025-02-28 11:31:14 +00:00
object docs: fix typos found by codespell in docs and code comments 2025-01-16 10:39:01 +01:00
operations build: modernize Go usage 2025-02-28 11:31:14 +00:00
rc build: modernize Go usage 2025-02-28 11:31:14 +00:00
sync build: modernize Go usage 2025-02-28 11:31:14 +00:00
walk build: modernize Go usage 2025-02-28 11:31:14 +00:00
backend_config_test.go fs: add --all to rclone config create/update to ask all the config questions #3455 2021-05-14 14:07:44 +01:00
backend_config.go build: modernize Go usage 2025-02-28 11:31:14 +00:00
bits_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
bits.go fs: fix docs for Bits 2023-10-23 15:43:55 +01:00
bwtimetable_test.go fs: Allow semicolons as well as spaces in --bwlimit timetable parsing - fixes #7595 2024-07-17 11:04:01 +01:00
bwtimetable.go build: modernize Go usage 2025-02-28 11:31:14 +00:00
config_list_test.go fs: fix tests for *SepList 2018-08-21 10:58:59 +01:00
config_list.go Make flags show up with their proper names, eg SizeSuffix rather than int 2019-02-07 11:57:26 +00:00
config_test.go build: add lint ignore comment required for golangci-staticcheck in addition to stand-alone staticcheck 2023-03-26 14:28:15 +02:00
config.go fs: make --links flag global and add new --local-links and --vfs-links flag 2024-12-13 12:43:20 +00:00
configmap.go fs: fix the defaults overriding the actual config 2024-07-15 11:09:54 +01:00
countsuffix_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
countsuffix.go build: fix gocritic lint issue dupbranchbody 2024-08-15 22:08:34 +01:00
cutoffmode_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
cutoffmode.go fs: re-implement CutoffMode, LogLevel, TerminalColorMode with Enum 2023-10-03 15:14:24 +01:00
daemon_other.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
daemon_unix.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
deletemode.go Break the fs package up into smaller parts. 2018-01-15 17:51:14 +00:00
dir_wrapper.go combine: fix CopyDirMetadata error on upstream root 2024-03-07 11:09:07 +00:00
dir.go fs: allow Metadata calls to be called with Directory or Object 2024-02-27 10:56:19 +00:00
direntries_test.go build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
direntries.go fs: Allow sync of a file and a directory with the same name 2019-06-09 15:57:05 +01:00
dump_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
dump.go fs: implement --metadata-mapper to transform metatadata with a user supplied program 2023-11-18 17:49:35 +00:00
enum_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
enum.go fs: re-implement CutoffMode, LogLevel, TerminalColorMode with Enum 2023-10-03 15:14:24 +01:00
features.go build: modernize Go usage 2025-02-28 11:31:14 +00:00
fingerprint_test.go mockfs: make it so it can be registered as an Fs 2023-04-28 14:31:05 +01:00
fingerprint.go fs: add Fingerprint to detect changes in an object 2020-06-30 12:01:36 +01:00
fs_test.go rc: add options/info call to enumerate options 2024-07-15 11:09:54 +01:00
fs.go fs: Move link suffix to fs 2024-12-13 12:43:20 +00:00
log_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
log.go build: modernize Go usage 2025-02-28 11:31:14 +00:00
metadata_mapper_code.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
metadata_test.go fs: implement --metadata-mapper to transform metatadata with a user supplied program 2023-11-18 17:49:35 +00:00
metadata.go fs: allow Metadata calls to be called with Directory or Object 2024-02-27 10:56:19 +00:00
mimetype.go dlna: set more correct mime type 2024-08-15 22:01:52 +01:00
mount_helper_test.go rclone.mount: ignore _netdev mount argument - FIxes #5808 2022-05-12 20:27:13 +01:00
mount_helper.go build: update logging statements to make json log work - fixes #6038 2024-09-06 17:04:18 +01:00
newfs_test.go mount: fix mount failure on macOS with on the fly remote 2023-06-23 14:12:03 +01:00
newfs.go fs: fix confusing "didn't find section in config file" error 2025-01-15 16:32:59 +00:00
open_options_test.go fs: add --metadata-set flag to specify metadata for uploads 2022-06-29 14:29:36 +01:00
open_options.go fs: fix Don't know how to set key "chunkSize" on upload errors in tests 2024-10-22 19:54:33 +01:00
override_dir_test.go fs: add OverrideDirectory for overriding path of directory 2023-05-14 11:22:57 +01:00
override_dir.go fs: add OverrideDirectory for overriding path of directory 2023-05-14 11:22:57 +01:00
override_test.go fs: move operations.NewOverrideRemote to fs.NewOverrideRemote 2022-11-21 08:02:09 +00:00
override.go fs: when creating new fs.OverrideRemotes don't layer overrides if not needed 2023-05-09 16:28:10 +01:00
pacer.go pacer: fix b2 deadlock by defaulting max connections to unlimited 2023-10-01 12:30:26 +01:00
parseduration_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
parseduration.go fs: improve JSON Unmarshalling for Duration 2024-03-13 18:08:59 +00:00
parsetime_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
parsetime.go rc: fix output of Time values in options/get 2023-05-04 15:04:11 +01:00
registry.go build: modernize Go usage 2025-02-28 11:31:14 +00:00
sizesuffix_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
sizesuffix.go build: fix gocritic lint issue dupbranchbody 2024-08-15 22:08:34 +01:00
terminalcolormode_test.go fs: re-implement CutoffMode, LogLevel, TerminalColorMode with Enum 2023-10-03 15:14:24 +01:00
terminalcolormode.go fs: re-implement CutoffMode, LogLevel, TerminalColorMode with Enum 2023-10-03 15:14:24 +01:00
tristate_test.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
tristate.go fs: fix tristate conversion to JSON 2023-03-27 16:17:49 +01:00
types.go fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere 2024-07-15 11:09:54 +01:00
version.go Configurable version suffix independent of version number 2022-05-17 12:10:01 +01:00
versioncheck.go build: make go1.23 the minimum go version 2025-02-26 18:00:58 +00:00
versionsuffix.go Configurable version suffix independent of version number 2022-05-17 12:10:01 +01:00
versiontag.go Start v1.70.0-DEV development 2025-01-12 16:31:12 +00:00