From 241916d55bb1af61e8bf46909a77e21e781fec98 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Wed, 6 Dec 2023 13:11:55 +0100 Subject: [PATCH] Fix typos --- CHANGELOG.md | 28 ++++++++++++------------ CONTRIBUTING.md | 2 +- changelog/0.10.0_2020-09-19/pull-2195 | 2 +- changelog/0.10.0_2020-09-19/pull-2668 | 2 +- changelog/0.12.0_2021-02-14/pull-3106 | 2 +- changelog/0.8.0_2017-11-26/pull-1040 | 2 +- changelog/0.8.0_2017-11-26/pull-1319 | 2 +- changelog/0.8.2_2018-02-17/issue-1506 | 2 +- changelog/0.8.3_2018-02-26/pull-1623 | 2 +- changelog/0.9.0_2018-05-21/pull-1735 | 2 +- changelog/0.9.3_2018-10-13/pull-1876 | 2 +- changelog/0.9.6_2019-11-22/issue-2179 | 2 +- cmd/restic/cmd_check.go | 2 +- cmd/restic/cmd_check_test.go | 6 ++--- cmd/restic/cmd_debug.go | 2 +- cmd/restic/cmd_prune.go | 8 +++---- cmd/restic/cmd_snapshots.go | 2 +- cmd/restic/global.go | 2 +- doc/fish-completion.fish | 2 +- helpers/prepare-release/main.go | 2 +- internal/archiver/archiver.go | 2 +- internal/backend/b2/b2.go | 2 +- internal/backend/backend.go | 2 +- internal/backend/limiter/limiter.go | 4 ++-- internal/backend/local/local.go | 2 +- internal/backend/sftp/sftp.go | 2 +- internal/backend/shell_split.go | 2 +- internal/backend/util/foreground_sysv.go | 2 +- internal/checker/checker.go | 2 +- internal/fs/vss_windows.go | 8 +++---- internal/fuse/dir.go | 2 +- internal/fuse/file.go | 2 +- internal/index/master_index.go | 2 +- internal/pack/pack.go | 2 +- internal/repository/packer_manager.go | 2 +- internal/repository/repack_test.go | 2 +- internal/repository/repository.go | 2 +- internal/repository/repository_test.go | 2 +- internal/restic/counted_blob_set_test.go | 2 +- internal/restic/snapshot_group_test.go | 2 +- internal/restorer/filerestorer_test.go | 2 +- internal/restorer/hardlinks_index.go | 2 +- internal/restorer/restorer_test.go | 2 +- internal/ui/termstatus/status.go | 2 +- internal/walker/rewriter_test.go | 2 +- 45 files changed, 67 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab07cc225..9ef44af9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2684,7 +2684,7 @@ Details * Enhancement #3106: Parallelize scan of snapshot content in `copy` and `prune` The `copy` and `prune` commands used to traverse the directories of snapshots one by one to find - used data. This snapshot traversal is now parallized which can speed up this step several + used data. This snapshot traversal is now parallelized which can speed up this step several times. In addition the `check` command now reports how many snapshots have already been processed. @@ -2784,7 +2784,7 @@ Details * Bugfix #1756: Mark repository files as read-only when using the local backend - Files stored in a local repository were marked as writeable on the filesystem for non-Windows + Files stored in a local repository were marked as writable on the filesystem for non-Windows systems, which did not prevent accidental file modifications outside of restic. In addition, the local backend did not work with certain filesystems and network mounts which do not permit modifications of file permissions. @@ -2874,7 +2874,7 @@ Details an exclusive lock through a filesystem snapshot. Restic was unable to backup those files before. This update enables backing up these files. - This needs to be enabled explicitely using the --use-fs-snapshot option of the backup + This needs to be enabled explicitly using the --use-fs-snapshot option of the backup command. https://github.com/restic/restic/issues/340 @@ -3079,7 +3079,7 @@ Details * Bugfix #2668: Don't abort the stats command when data blobs are missing - Runing the stats command in the blobs-per-file mode on a repository with missing data blobs + Running the stats command in the blobs-per-file mode on a repository with missing data blobs previously resulted in a crash. https://github.com/restic/restic/pull/2668 @@ -3454,7 +3454,7 @@ Details check will be disabled if the --ignore-inode flag was given. If this change causes problems for you, please open an issue, and we can look in to adding a - seperate flag to disable just the ctime check. + separate flag to disable just the ctime check. https://github.com/restic/restic/issues/2179 https://github.com/restic/restic/pull/2212 @@ -3826,7 +3826,7 @@ Details * Enhancement #1876: Display reason why forget keeps snapshots We've added a column to the list of snapshots `forget` keeps which details the reasons to keep a - particuliar snapshot. This makes debugging policies for forget much easier. Please remember + particular snapshot. This makes debugging policies for forget much easier. Please remember to always try things out with `--dry-run`! https://github.com/restic/restic/pull/1876 @@ -4139,7 +4139,7 @@ Summary * Enh #1665: Improve cache handling for `restic check` * Enh #1709: Improve messages `restic check` prints * Enh #1721: Add `cache` command to list cache dirs - * Enh #1735: Allow keeping a time range of snaphots + * Enh #1735: Allow keeping a time range of snapshots * Enh #1758: Allow saving OneDrive folders in Windows * Enh #1782: Use default AWS credentials chain for S3 backend @@ -4339,7 +4339,7 @@ Details https://github.com/restic/restic/issues/1721 https://github.com/restic/restic/pull/1749 - * Enhancement #1735: Allow keeping a time range of snaphots + * Enhancement #1735: Allow keeping a time range of snapshots We've added the `--keep-within` option to the `forget` command. It instructs restic to keep all snapshots within the given duration since the newest snapshot. For example, running @@ -4440,7 +4440,7 @@ Details HTTP) and returning an error when the file already exists. This is not accurate, the file could have been created between the HTTP request testing for it, - and when writing starts, so we've relaxed this requeriment, which saves one additional HTTP + and when writing starts, so we've relaxed this requirement, which saves one additional HTTP request per newly added file. https://github.com/restic/restic/pull/1623 @@ -4463,7 +4463,7 @@ restic users. The changes are ordered by importance. Summary ------- - * Fix #1506: Limit bandwith at the http.RoundTripper for HTTP based backends + * Fix #1506: Limit bandwidth at the http.RoundTripper for HTTP based backends * Fix #1512: Restore directory permissions as the last step * Fix #1528: Correctly create missing subdirs in data/ * Fix #1589: Complete intermediate index upload @@ -4484,7 +4484,7 @@ Summary Details ------- - * Bugfix #1506: Limit bandwith at the http.RoundTripper for HTTP based backends + * Bugfix #1506: Limit bandwidth at the http.RoundTripper for HTTP based backends https://github.com/restic/restic/issues/1506 https://github.com/restic/restic/pull/1511 @@ -4537,7 +4537,7 @@ Details * Bugfix #1595: Backup: Remove bandwidth display This commit removes the bandwidth displayed during backup process. It is misleading and - seldomly correct, because it's neither the "read bandwidth" (only for the very first backup) + seldom correct, because it's neither the "read bandwidth" (only for the very first backup) nor the "upload bandwidth". Many users are confused about (and rightly so), c.f. #1581, #1033, #1591 @@ -4807,7 +4807,7 @@ Details We've added a local cache for metadata so that restic doesn't need to load all metadata (snapshots, indexes, ...) from the repo each time it starts. By default the cache is active, but - there's a new global option `--no-cache` that can be used to disable the cache. By deafult, the + there's a new global option `--no-cache` that can be used to disable the cache. By default, the cache a standard cache folder for the OS, which can be overridden with `--cache-dir`. The cache will automatically populate, indexes and snapshots are saved as they are loaded. Cache directories for repos that haven't been used recently can automatically be removed by restic @@ -4893,7 +4893,7 @@ Details * Enhancement #1319: Make `check` print `no errors found` explicitly - The `check` command now explicetly prints `No errors were found` when no errors could be found. + The `check` command now explicitly prints `No errors were found` when no errors could be found. https://github.com/restic/restic/issues/1303 https://github.com/restic/restic/pull/1319 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 39a829337..4318a2107 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,7 @@ uploading it somewhere or post only the parts that are really relevant. If restic gets stuck, please also include a stacktrace in the description. On non-Windows systems, you can send a SIGQUIT signal to restic or press `Ctrl-\` to achieve the same result. This causes restic to print a stacktrace -and then exit immediatelly. This will not damage your repository, however, +and then exit immediately. This will not damage your repository, however, it might be necessary to manually clean up stale lock files using `restic unlock`. diff --git a/changelog/0.10.0_2020-09-19/pull-2195 b/changelog/0.10.0_2020-09-19/pull-2195 index a139aa4e1..7898568fa 100644 --- a/changelog/0.10.0_2020-09-19/pull-2195 +++ b/changelog/0.10.0_2020-09-19/pull-2195 @@ -10,7 +10,7 @@ https://github.com/restic/restic/issues/2244 NOTE: This new implementation does not guarantee order in which blobs are written to the target files and, for example, the last blob of a -file can be written to the file before any of the preceeding file blobs. +file can be written to the file before any of the preceding file blobs. It is therefore possible to have gaps in the data written to the target files if restore fails or interrupted by the user. diff --git a/changelog/0.10.0_2020-09-19/pull-2668 b/changelog/0.10.0_2020-09-19/pull-2668 index 94a661c05..dd95587ce 100644 --- a/changelog/0.10.0_2020-09-19/pull-2668 +++ b/changelog/0.10.0_2020-09-19/pull-2668 @@ -1,6 +1,6 @@ Bugfix: Don't abort the stats command when data blobs are missing -Runing the stats command in the blobs-per-file mode on a repository with +Running the stats command in the blobs-per-file mode on a repository with missing data blobs previously resulted in a crash. https://github.com/restic/restic/pull/2668 diff --git a/changelog/0.12.0_2021-02-14/pull-3106 b/changelog/0.12.0_2021-02-14/pull-3106 index 2d5857de7..f0cb54df0 100644 --- a/changelog/0.12.0_2021-02-14/pull-3106 +++ b/changelog/0.12.0_2021-02-14/pull-3106 @@ -2,7 +2,7 @@ Enhancement: Parallelize scan of snapshot content in `copy` and `prune` The `copy` and `prune` commands used to traverse the directories of snapshots one by one to find used data. This snapshot traversal is -now parallized which can speed up this step several times. +now parallelized which can speed up this step several times. In addition the `check` command now reports how many snapshots have already been processed. diff --git a/changelog/0.8.0_2017-11-26/pull-1040 b/changelog/0.8.0_2017-11-26/pull-1040 index b39ee2fee..190ed01f8 100644 --- a/changelog/0.8.0_2017-11-26/pull-1040 +++ b/changelog/0.8.0_2017-11-26/pull-1040 @@ -3,7 +3,7 @@ Enhancement: Add local metadata cache We've added a local cache for metadata so that restic doesn't need to load all metadata (snapshots, indexes, ...) from the repo each time it starts. By default the cache is active, but there's a new global option `--no-cache` -that can be used to disable the cache. By deafult, the cache a standard +that can be used to disable the cache. By default, the cache a standard cache folder for the OS, which can be overridden with `--cache-dir`. The cache will automatically populate, indexes and snapshots are saved as they are loaded. Cache directories for repos that haven't been used recently can diff --git a/changelog/0.8.0_2017-11-26/pull-1319 b/changelog/0.8.0_2017-11-26/pull-1319 index d74a3f947..efc2e2c8a 100644 --- a/changelog/0.8.0_2017-11-26/pull-1319 +++ b/changelog/0.8.0_2017-11-26/pull-1319 @@ -1,6 +1,6 @@ Enhancement: Make `check` print `no errors found` explicitly -The `check` command now explicetly prints `No errors were found` when no errors +The `check` command now explicitly prints `No errors were found` when no errors could be found. https://github.com/restic/restic/pull/1319 diff --git a/changelog/0.8.2_2018-02-17/issue-1506 b/changelog/0.8.2_2018-02-17/issue-1506 index 5f0122529..aca77c458 100644 --- a/changelog/0.8.2_2018-02-17/issue-1506 +++ b/changelog/0.8.2_2018-02-17/issue-1506 @@ -1,4 +1,4 @@ -Bugfix: Limit bandwith at the http.RoundTripper for HTTP based backends +Bugfix: Limit bandwidth at the http.RoundTripper for HTTP based backends https://github.com/restic/restic/issues/1506 https://github.com/restic/restic/pull/1511 diff --git a/changelog/0.8.3_2018-02-26/pull-1623 b/changelog/0.8.3_2018-02-26/pull-1623 index 0e03ee776..1579a9ebc 100644 --- a/changelog/0.8.3_2018-02-26/pull-1623 +++ b/changelog/0.8.3_2018-02-26/pull-1623 @@ -6,7 +6,7 @@ that means making a request (e.g. via HTTP) and returning an error when the file already exists. This is not accurate, the file could have been created between the HTTP request -testing for it, and when writing starts, so we've relaxed this requeriment, +testing for it, and when writing starts, so we've relaxed this requirement, which saves one additional HTTP request per newly added file. https://github.com/restic/restic/pull/1623 diff --git a/changelog/0.9.0_2018-05-21/pull-1735 b/changelog/0.9.0_2018-05-21/pull-1735 index 2cfd115d8..fbf6135a6 100644 --- a/changelog/0.9.0_2018-05-21/pull-1735 +++ b/changelog/0.9.0_2018-05-21/pull-1735 @@ -1,4 +1,4 @@ -Enhancement: Allow keeping a time range of snaphots +Enhancement: Allow keeping a time range of snapshots We've added the `--keep-within` option to the `forget` command. It instructs restic to keep all snapshots within the given duration since the newest diff --git a/changelog/0.9.3_2018-10-13/pull-1876 b/changelog/0.9.3_2018-10-13/pull-1876 index 2fb1a8ea8..aa92b24e8 100644 --- a/changelog/0.9.3_2018-10-13/pull-1876 +++ b/changelog/0.9.3_2018-10-13/pull-1876 @@ -1,7 +1,7 @@ Enhancement: Display reason why forget keeps snapshots We've added a column to the list of snapshots `forget` keeps which details the -reasons to keep a particuliar snapshot. This makes debugging policies for +reasons to keep a particular snapshot. This makes debugging policies for forget much easier. Please remember to always try things out with `--dry-run`! https://github.com/restic/restic/pull/1876 diff --git a/changelog/0.9.6_2019-11-22/issue-2179 b/changelog/0.9.6_2019-11-22/issue-2179 index e87778d17..96589f9cf 100644 --- a/changelog/0.9.6_2019-11-22/issue-2179 +++ b/changelog/0.9.6_2019-11-22/issue-2179 @@ -9,7 +9,7 @@ file should be noticed, and the modified file will be backed up. The ctime check will be disabled if the --ignore-inode flag was given. If this change causes problems for you, please open an issue, and we can look in -to adding a seperate flag to disable just the ctime check. +to adding a separate flag to disable just the ctime check. https://github.com/restic/restic/issues/2179 https://github.com/restic/restic/pull/2212 diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index fd512c7e7..f04a4fe71 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -417,7 +417,7 @@ func selectPacksByBucket(allPacks map[restic.ID]int64, bucket, totalBuckets uint return packs } -// selectRandomPacksByPercentage selects the given percentage of packs which are randomly choosen. +// selectRandomPacksByPercentage selects the given percentage of packs which are randomly chosen. func selectRandomPacksByPercentage(allPacks map[restic.ID]int64, percentage float64) map[restic.ID]int64 { packCount := len(allPacks) packsToCheck := int(float64(packCount) * (percentage / 100.0)) diff --git a/cmd/restic/cmd_check_test.go b/cmd/restic/cmd_check_test.go index fb61f8420..4d54488cd 100644 --- a/cmd/restic/cmd_check_test.go +++ b/cmd/restic/cmd_check_test.go @@ -71,7 +71,7 @@ func TestSelectPacksByBucket(t *testing.T) { var testPacks = make(map[restic.ID]int64) for i := 1; i <= 10; i++ { id := restic.NewRandomID() - // ensure relevant part of generated id is reproducable + // ensure relevant part of generated id is reproducible id[0] = byte(i) testPacks[id] = 0 } @@ -124,7 +124,7 @@ func TestSelectRandomPacksByPercentage(t *testing.T) { } func TestSelectNoRandomPacksByPercentage(t *testing.T) { - // that the a repository without pack files works + // that the repository without pack files works var testPacks = make(map[restic.ID]int64) selectedPacks := selectRandomPacksByPercentage(testPacks, 10.0) rtest.Assert(t, len(selectedPacks) == 0, "Expected 0 selected packs") @@ -158,7 +158,7 @@ func TestSelectRandomPacksByFileSize(t *testing.T) { } func TestSelectNoRandomPacksByFileSize(t *testing.T) { - // that the a repository without pack files works + // that the repository without pack files works var testPacks = make(map[restic.ID]int64) selectedPacks := selectRandomPacksByFileSize(testPacks, 10, 500) rtest.Assert(t, len(selectedPacks) == 0, "Expected 0 selected packs") diff --git a/cmd/restic/cmd_debug.go b/cmd/restic/cmd_debug.go index f679bf61e..60413de21 100644 --- a/cmd/restic/cmd_debug.go +++ b/cmd/restic/cmd_debug.go @@ -290,7 +290,7 @@ func tryRepairWithBitflip(ctx context.Context, key *crypto.Key, input []byte, by }) err := wg.Wait() if err != nil { - panic("all go rountines can only return nil") + panic("all go routines can only return nil") } if !found { diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index 3994620ab..739a450df 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -406,7 +406,7 @@ func packInfoFromIndex(ctx context.Context, idx restic.MasterIndex, usedBlobs re }) // if duplicate blobs exist, those will be set to either "used" or "unused": - // - mark only one occurence of duplicate blobs as used + // - mark only one occurrence of duplicate blobs as used // - if there are already some used blobs in a pack, possibly mark duplicates in this pack as "used" // - if there are no used blobs in a pack, possibly mark duplicates as "unused" if hasDuplicates { @@ -415,7 +415,7 @@ func packInfoFromIndex(ctx context.Context, idx restic.MasterIndex, usedBlobs re bh := blob.BlobHandle count, ok := usedBlobs[bh] // skip non-duplicate, aka. normal blobs - // count == 0 is used to mark that this was a duplicate blob with only a single occurence remaining + // count == 0 is used to mark that this was a duplicate blob with only a single occurrence remaining if !ok || count == 1 { return } @@ -424,7 +424,7 @@ func packInfoFromIndex(ctx context.Context, idx restic.MasterIndex, usedBlobs re size := uint64(blob.Length) switch { case ip.usedBlobs > 0, count == 0: - // other used blobs in pack or "last" occurence -> transition to used + // other used blobs in pack or "last" occurrence -> transition to used ip.usedSize += size ip.usedBlobs++ ip.unusedSize -= size @@ -434,7 +434,7 @@ func packInfoFromIndex(ctx context.Context, idx restic.MasterIndex, usedBlobs re stats.blobs.used++ stats.size.duplicate -= size stats.blobs.duplicate-- - // let other occurences remain marked as unused + // let other occurrences remain marked as unused usedBlobs[bh] = 1 default: // remain unused and decrease counter diff --git a/cmd/restic/cmd_snapshots.go b/cmd/restic/cmd_snapshots.go index c45c7c344..e94f2ed9b 100644 --- a/cmd/restic/cmd_snapshots.go +++ b/cmd/restic/cmd_snapshots.go @@ -290,7 +290,7 @@ func PrintSnapshotGroupHeader(stdout io.Writer, groupKeyJSON string) error { return nil } -// Snapshot helps to print Snaphots as JSON with their ID included. +// Snapshot helps to print Snapshots as JSON with their ID included. type Snapshot struct { *restic.Snapshot diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 468f2c50b..65cfda03d 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -127,7 +127,7 @@ func init() { f.StringVarP(&globalOptions.KeyHint, "key-hint", "", "", "`key` ID of key to try decrypting first (default: $RESTIC_KEY_HINT)") f.StringVarP(&globalOptions.PasswordCommand, "password-command", "", "", "shell `command` to obtain the repository password from (default: $RESTIC_PASSWORD_COMMAND)") f.BoolVarP(&globalOptions.Quiet, "quiet", "q", false, "do not output comprehensive progress report") - // use empty paremeter name as `-v, --verbose n` instead of the correct `--verbose=n` is confusing + // use empty parameter name as `-v, --verbose n` instead of the correct `--verbose=n` is confusing f.CountVarP(&globalOptions.Verbose, "verbose", "v", "be verbose (specify multiple times or a level using --verbose=n``, max level/times is 2)") f.BoolVar(&globalOptions.NoLock, "no-lock", false, "do not lock the repository, this allows some operations on read-only repositories") f.DurationVar(&globalOptions.RetryLock, "retry-lock", 0, "retry to lock the repository if it is already locked, takes a value like 5m or 2h (default: no retries)") diff --git a/doc/fish-completion.fish b/doc/fish-completion.fish index f9d7801e1..7db10cb20 100644 --- a/doc/fish-completion.fish +++ b/doc/fish-completion.fish @@ -79,7 +79,7 @@ function __restic_clear_perform_completion_once_result __restic_debug "" __restic_debug "========= clearing previously set __restic_perform_completion_once_result variable ==========" set --erase __restic_perform_completion_once_result - __restic_debug "Succesfully erased the variable __restic_perform_completion_once_result" + __restic_debug "Successfully erased the variable __restic_perform_completion_once_result" end function __restic_requires_order_preservation diff --git a/helpers/prepare-release/main.go b/helpers/prepare-release/main.go index a6c7bd4f4..baf8aa2ba 100644 --- a/helpers/prepare-release/main.go +++ b/helpers/prepare-release/main.go @@ -379,7 +379,7 @@ func readdir(dir string) []string { } func sha256sums(inputDir, outputFile string) { - msg("runnnig sha256sum in %v", inputDir) + msg("running sha256sum in %v", inputDir) filenames := readdir(inputDir) diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 98819d797..e2f22ebea 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -267,7 +267,7 @@ func (arch *Archiver) SaveDir(ctx context.Context, snPath string, dir string, fi // FutureNode holds a reference to a channel that returns a FutureNodeResult // or a reference to an already existing result. If the result is available -// immediatelly, then storing a reference directly requires less memory than +// immediately, then storing a reference directly requires less memory than // using the indirection via a channel. type FutureNode struct { ch <-chan futureNodeResult diff --git a/internal/backend/b2/b2.go b/internal/backend/b2/b2.go index 451e18810..bc6ef1a4d 100644 --- a/internal/backend/b2/b2.go +++ b/internal/backend/b2/b2.go @@ -31,7 +31,7 @@ type b2Backend struct { canDelete bool } -// Billing happens in 1000 item granlarity, but we are more interested in reducing the number of network round trips +// Billing happens in 1000 item granularity, but we are more interested in reducing the number of network round trips const defaultListMaxItems = 10 * 1000 // ensure statically that *b2Backend implements backend.Backend. diff --git a/internal/backend/backend.go b/internal/backend/backend.go index cdefdda79..aa9920f9b 100644 --- a/internal/backend/backend.go +++ b/internal/backend/backend.go @@ -18,7 +18,7 @@ type Backend interface { // repository. Location() string - // Connections returns the maxmimum number of concurrent backend operations. + // Connections returns the maximum number of concurrent backend operations. Connections() uint // Hasher may return a hash function for calculating a content hash for the backend diff --git a/internal/backend/limiter/limiter.go b/internal/backend/limiter/limiter.go index 8cbe297fe..7ba5ad02b 100644 --- a/internal/backend/limiter/limiter.go +++ b/internal/backend/limiter/limiter.go @@ -5,8 +5,8 @@ import ( "net/http" ) -// Limiter defines an interface that implementors can use to rate limit I/O -// according to some policy defined and configured by the implementor. +// Limiter defines an interface that implementers can use to rate limit I/O +// according to some policy defined and configured by the implementer. type Limiter interface { // Upstream returns a rate limited reader that is intended to be used in // uploads. diff --git a/internal/backend/local/local.go b/internal/backend/local/local.go index 4898bfc7a..b89f2ff44 100644 --- a/internal/backend/local/local.go +++ b/internal/backend/local/local.go @@ -194,7 +194,7 @@ func (b *Local) Save(_ context.Context, h backend.Handle, rd backend.RewindReade } } - // try to mark file as read-only to avoid accidential modifications + // try to mark file as read-only to avoid accidental modifications // ignore if the operation fails as some filesystems don't allow the chmod call // e.g. exfat and network file systems with certain mount options err = setFileReadonly(finalname, b.Modes.File) diff --git a/internal/backend/sftp/sftp.go b/internal/backend/sftp/sftp.go index 6f6a34548..0a94e4aa3 100644 --- a/internal/backend/sftp/sftp.go +++ b/internal/backend/sftp/sftp.go @@ -302,7 +302,7 @@ func Join(parts ...string) string { } // tempSuffix generates a random string suffix that should be sufficiently long -// to avoid accidential conflicts +// to avoid accidental conflicts func tempSuffix() string { var nonce [16]byte _, err := rand.Read(nonce[:]) diff --git a/internal/backend/shell_split.go b/internal/backend/shell_split.go index eff527616..888c993a0 100644 --- a/internal/backend/shell_split.go +++ b/internal/backend/shell_split.go @@ -6,7 +6,7 @@ import ( "github.com/restic/restic/internal/errors" ) -// shellSplitter splits a command string into separater arguments. It supports +// shellSplitter splits a command string into separated arguments. It supports // single and double quoted strings. type shellSplitter struct { quote rune diff --git a/internal/backend/util/foreground_sysv.go b/internal/backend/util/foreground_sysv.go index 6535441aa..ec06aa677 100644 --- a/internal/backend/util/foreground_sysv.go +++ b/internal/backend/util/foreground_sysv.go @@ -11,7 +11,7 @@ import ( ) func startForeground(cmd *exec.Cmd) (bg func() error, err error) { - // run the command in it's own process group so that SIGINT + // run the command in its own process group so that SIGINT // is not sent to it. cmd.SysProcAttr = &syscall.SysProcAttr{ Setpgid: true, diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 22c0e03bd..3bc0fac87 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -442,7 +442,7 @@ func (c *Checker) checkTree(id restic.ID, tree *restic.Tree) (errs []error) { } // Note that we do not use the blob size. The "obvious" check // whether the sum of the blob sizes matches the file size - // unfortunately fails in some cases that are not resolveable + // unfortunately fails in some cases that are not resolvable // by users, so we omit this check, see #1887 _, found := c.repo.LookupBlobSize(blobID, restic.DataBlob) diff --git a/internal/fs/vss_windows.go b/internal/fs/vss_windows.go index bd82f4405..8c9b8942b 100644 --- a/internal/fs/vss_windows.go +++ b/internal/fs/vss_windows.go @@ -166,7 +166,7 @@ func (h HRESULT) Str() string { return "UNKNOWN" } -// VssError encapsulates errors retruned from calling VSS api. +// VssError encapsulates errors returned from calling VSS api. type vssError struct { text string hresult HRESULT @@ -190,7 +190,7 @@ func (e *vssError) Error() string { return fmt.Sprintf("VSS error: %s: %s (%#x)", e.text, e.hresult.Str(), e.hresult) } -// VssError encapsulates errors retruned from calling VSS api. +// VssError encapsulates errors returned from calling VSS api. type vssTextError struct { text string } @@ -615,7 +615,7 @@ func (vssAsync *IVSSAsync) QueryStatus() (HRESULT, uint32) { return HRESULT(result), state } -// WaitUntilAsyncFinished waits until either the async call is finshed or +// WaitUntilAsyncFinished waits until either the async call is finished or // the given timeout is reached. func (vssAsync *IVSSAsync) WaitUntilAsyncFinished(millis uint32) error { hresult := vssAsync.Wait(millis) @@ -858,7 +858,7 @@ func NewVssSnapshot( if err != nil { // After calling PrepareForBackup one needs to call AbortBackup() before releasing the VSS // instance for proper cleanup. - // It is not neccessary to call BackupComplete before releasing the VSS instance afterwards. + // It is not necessary to call BackupComplete before releasing the VSS instance afterwards. iVssBackupComponents.AbortBackup() iVssBackupComponents.Release() return VssSnapshot{}, err diff --git a/internal/fuse/dir.go b/internal/fuse/dir.go index 242b4b03e..c5aaf6f52 100644 --- a/internal/fuse/dir.go +++ b/internal/fuse/dir.go @@ -46,7 +46,7 @@ func newDir(root *Root, inode, parentInode uint64, node *restic.Node) (*dir, err }, nil } -// returing a wrapped context.Canceled error will instead result in returing +// returning a wrapped context.Canceled error will instead result in returning // an input / output error to the user. Thus unwrap the error to match the // expectations of bazil/fuse func unwrapCtxCanceled(err error) error { diff --git a/internal/fuse/file.go b/internal/fuse/file.go index 2fedf30bf..6152c9122 100644 --- a/internal/fuse/file.go +++ b/internal/fuse/file.go @@ -142,7 +142,7 @@ func (f *openFile) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.R // Multiple goroutines may call service methods simultaneously; // the methods being called are responsible for appropriate synchronization. // - // However, no lock needed here as getBlobAt can be called conurrently + // However, no lock needed here as getBlobAt can be called concurrently // (blobCache has its own locking) for i := startContent; remainingBytes > 0 && i < len(f.cumsize)-1; i++ { blob, err := f.getBlobAt(ctx, i) diff --git a/internal/index/master_index.go b/internal/index/master_index.go index ca7c16135..073c9ace4 100644 --- a/internal/index/master_index.go +++ b/internal/index/master_index.go @@ -25,7 +25,7 @@ type MasterIndex struct { func NewMasterIndex() *MasterIndex { // Always add an empty final index, such that MergeFinalIndexes can merge into this. // Note that removing this index could lead to a race condition in the rare - // sitation that only two indexes exist which are saved and merged concurrently. + // situation that only two indexes exist which are saved and merged concurrently. idx := []*Index{NewIndex()} idx[0].Finalize() return &MasterIndex{idx: idx, pendingBlobs: restic.NewBlobSet()} diff --git a/internal/pack/pack.go b/internal/pack/pack.go index 34ad9d071..211af7bfb 100644 --- a/internal/pack/pack.go +++ b/internal/pack/pack.go @@ -189,7 +189,7 @@ const ( // MaxHeaderSize is the max size of header including header-length field MaxHeaderSize = 16*1024*1024 + headerLengthSize - // number of header enries to download as part of header-length request + // number of header entries to download as part of header-length request eagerEntries = 15 ) diff --git a/internal/repository/packer_manager.go b/internal/repository/packer_manager.go index 3b0ae12a7..22eca0c2e 100644 --- a/internal/repository/packer_manager.go +++ b/internal/repository/packer_manager.go @@ -39,7 +39,7 @@ type packerManager struct { packSize uint } -// newPackerManager returns an new packer manager which writes temporary files +// newPackerManager returns a new packer manager which writes temporary files // to a temporary directory func newPackerManager(key *crypto.Key, tpe restic.BlobType, packSize uint, queueFn func(ctx context.Context, t restic.BlobType, p *Packer) error) *packerManager { return &packerManager{ diff --git a/internal/repository/repack_test.go b/internal/repository/repack_test.go index 5846a4f21..20f0f2685 100644 --- a/internal/repository/repack_test.go +++ b/internal/repository/repack_test.go @@ -83,7 +83,7 @@ func createRandomWrongBlob(t testing.TB, repo restic.Repository) { } // selectBlobs splits the list of all blobs randomly into two lists. A blob -// will be contained in the firstone ith probability p. +// will be contained in the firstone with probability p. func selectBlobs(t *testing.T, repo restic.Repository, p float32) (list1, list2 restic.BlobSet) { list1 = restic.NewBlobSet() list2 = restic.NewBlobSet() diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 4779e94fa..f78c55e1d 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -932,7 +932,7 @@ func streamPackPart(ctx context.Context, beLoad BackendLoadFn, key *crypto.Key, ctx, cancel := context.WithCancel(ctx) // stream blobs in pack err = beLoad(ctx, h, int(dataEnd-dataStart), int64(dataStart), func(rd io.Reader) error { - // prevent callbacks after cancelation + // prevent callbacks after cancellation if ctx.Err() != nil { return ctx.Err() } diff --git a/internal/repository/repository_test.go b/internal/repository/repository_test.go index 5dcf21ebe..bb8395436 100644 --- a/internal/repository/repository_test.go +++ b/internal/repository/repository_test.go @@ -523,7 +523,7 @@ func testStreamPack(t *testing.T, version uint) { case 2: compress = true default: - t.Fatal("test does not suport repository version", version) + t.Fatal("test does not support repository version", version) } packfileBlobs, packfile := buildPackfileWithoutHeader(blobSizes, &key, compress) diff --git a/internal/restic/counted_blob_set_test.go b/internal/restic/counted_blob_set_test.go index 681751e91..edd39e65b 100644 --- a/internal/restic/counted_blob_set_test.go +++ b/internal/restic/counted_blob_set_test.go @@ -13,7 +13,7 @@ func TestCountedBlobSet(t *testing.T) { test.Equals(t, bs.List(), restic.BlobHandles{}) bh := restic.NewRandomBlobHandle() - // check non existant + // check non existent test.Equals(t, bs.Has(bh), false) // test insert diff --git a/internal/restic/snapshot_group_test.go b/internal/restic/snapshot_group_test.go index 78ac99ab1..f9d6ff460 100644 --- a/internal/restic/snapshot_group_test.go +++ b/internal/restic/snapshot_group_test.go @@ -38,7 +38,7 @@ func TestGroupByOptions(t *testing.T) { var opts restic.SnapshotGroupByOptions test.OK(t, opts.Set(exp.from)) if !cmp.Equal(opts, exp.opts) { - t.Errorf("unexpeted opts %s", cmp.Diff(opts, exp.opts)) + t.Errorf("unexpected opts %s", cmp.Diff(opts, exp.opts)) } test.Equals(t, opts.String(), exp.normalized) } diff --git a/internal/restorer/filerestorer_test.go b/internal/restorer/filerestorer_test.go index ba642ace4..aa9a2392d 100644 --- a/internal/restorer/filerestorer_test.go +++ b/internal/restorer/filerestorer_test.go @@ -296,7 +296,7 @@ func testPartialDownloadError(t *testing.T, part int) { // loader always returns an error loader := repo.loader repo.loader = func(ctx context.Context, h backend.Handle, length int, offset int64, fn func(rd io.Reader) error) error { - // only load partial data to execise fault handling in different places + // only load partial data to exercise fault handling in different places err := loader(ctx, h, length*part/100, offset, fn) if err == nil { return nil diff --git a/internal/restorer/hardlinks_index.go b/internal/restorer/hardlinks_index.go index 208a38ad0..d069fb4cb 100644 --- a/internal/restorer/hardlinks_index.go +++ b/internal/restorer/hardlinks_index.go @@ -22,7 +22,7 @@ func NewHardlinkIndex[T any]() *HardlinkIndex[T] { } } -// Has checks wether the link already exist in the index. +// Has checks whether the link already exist in the index. func (idx *HardlinkIndex[T]) Has(inode uint64, device uint64) bool { idx.m.Lock() defer idx.m.Unlock() diff --git a/internal/restorer/restorer_test.go b/internal/restorer/restorer_test.go index 6c45d5556..d0e7dad6f 100644 --- a/internal/restorer/restorer_test.go +++ b/internal/restorer/restorer_test.go @@ -791,7 +791,7 @@ func TestRestorerConsistentTimestampsAndPermissions(t *testing.T) { } } -// VerifyFiles must not report cancelation of its context through res.Error. +// VerifyFiles must not report cancellation of its context through res.Error. func TestVerifyCancel(t *testing.T) { snapshot := Snapshot{ Nodes: map[string]Node{ diff --git a/internal/ui/termstatus/status.go b/internal/ui/termstatus/status.go index 6e8ddfe7c..95286de99 100644 --- a/internal/ui/termstatus/status.go +++ b/internal/ui/termstatus/status.go @@ -325,7 +325,7 @@ func Truncate(s string, w int) string { // Guess whether the first rune in s would occupy two terminal cells // instead of one. This cannot be determined exactly without knowing -// the terminal font, so we treat all ambigous runes as full-width, +// the terminal font, so we treat all ambiguous runes as full-width, // i.e., two cells. func wideRune(s string) (wide bool, utfsize uint) { prop, size := width.LookupString(s) diff --git a/internal/walker/rewriter_test.go b/internal/walker/rewriter_test.go index 716217ac6..e5fcb9915 100644 --- a/internal/walker/rewriter_test.go +++ b/internal/walker/rewriter_test.go @@ -69,7 +69,7 @@ func checkRewriteItemOrder(want []string) checkRewriteFunc { } } -// checkRewriteSkips excludes nodes if path is in skipFor, it checks that rewriting proceedes in the correct order. +// checkRewriteSkips excludes nodes if path is in skipFor, it checks that rewriting proceeds in the correct order. func checkRewriteSkips(skipFor map[string]struct{}, want []string, disableCache bool) checkRewriteFunc { var pos int