Apply go fix -stringsseq ./...

This commit is contained in:
Michael Eischer
2026-07-22 22:27:07 +02:00
parent 31e96f4ec9
commit 58f92708c2
10 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -755,7 +755,7 @@ func TestBackupExcludeWithOutput(t *testing.T) {
rtest.OK(t, err)
foundExclude := false
for _, line := range bytes.Split(output, []byte("\n")) {
for line := range bytes.SplitSeq(output, []byte("\n")) {
if len(line) == 0 {
continue
}
+1 -1
View File
@@ -43,7 +43,7 @@ func testLsOutputContainsCount(t testing.TB, gopts global.Options, lsOpts LsOpti
t.Helper()
out := testRunLsWithOpts(t, gopts, lsOpts, lsArgs)
count := 0
for _, line := range strings.Split(string(out), "\n") {
for line := range strings.SplitSeq(string(out), "\n") {
if strings.Contains(line, substring) {
count++
}
+1 -1
View File
@@ -17,7 +17,7 @@ import (
)
func findSFTPServerBinary() string {
for _, dir := range strings.Split(rtest.TestSFTPPath, ":") {
for dir := range strings.SplitSeq(rtest.TestSFTPPath, ":") {
testpath := filepath.Join(dir, "sftp-server")
_, err := os.Stat(testpath)
if !errors.Is(err, os.ErrNotExist) {
+1 -1
View File
@@ -15,7 +15,7 @@ type SnapshotGroupByOptions struct {
func splitSnapshotGroupBy(s string) (SnapshotGroupByOptions, error) {
var l SnapshotGroupByOptions
for _, option := range strings.Split(s, ",") {
for option := range strings.SplitSeq(s, ",") {
switch option {
case "host", "hosts":
l.Host = true
+1 -1
View File
@@ -12,7 +12,7 @@ type TagList []string
// need to be separated by commas. Whitespace is stripped around the individual
// tags.
func splitTagList(s string) (l TagList) {
for _, t := range strings.Split(s, ",") {
for t := range strings.SplitSeq(s, ",") {
l = append(l, strings.TrimSpace(t))
}
return l
+1 -1
View File
@@ -61,7 +61,7 @@ func parseFilter(envname string, pad func(string) string) map[string]bool {
return filter
}
for _, fn := range strings.Split(env, ",") {
for fn := range strings.SplitSeq(env, ",") {
t := pad(strings.TrimSpace(fn))
val := true
switch t[0] {
+1 -1
View File
@@ -64,7 +64,7 @@ func (f *FlagSet) Apply(flags string, logWarning func(string)) error {
selection := make(map[string]bool)
for _, flag := range strings.Split(flags, ",") {
for flag := range strings.SplitSeq(flags, ",") {
parts := strings.SplitN(flag, "=", 2)
name := parts[0]
+1 -1
View File
@@ -72,7 +72,7 @@ func parseMountPoints(list string, msgError ErrorHandler) (volumes map[string]st
if list == "" {
return
}
for _, s := range strings.Split(list, ";") {
for s := range strings.SplitSeq(list, ";") {
if v, err := getVolumeNameForVolumeMountPoint(s); err != nil {
msgError(s, errors.Errorf("failed to parse vss.exclude-volumes [%s]: %s", s, err))
} else {
+1 -1
View File
@@ -46,7 +46,7 @@ func getBoolVar(name string, defaultValue bool) bool {
// names that must be run. If name is in this list, the test is marked as
// failed.
func SkipDisallowed(t testing.TB, name string) {
for _, s := range strings.Split(testIntegrationDisallowSkip, ",") {
for s := range strings.SplitSeq(testIntegrationDisallowSkip, ",") {
if s == name {
t.Fatalf("test %v is in list of tests that need to run ($RESTIC_TEST_DISALLOW_SKIP)", name)
}
+2 -2
View File
@@ -139,7 +139,7 @@ func (t *Table) Write(w io.Writer) error {
// find max width for each cell
columnWidths := make([]int, columns)
for i, desc := range t.columns {
for _, line := range strings.Split(desc, "\n") {
for line := range strings.SplitSeq(desc, "\n") {
width := ui.DisplayWidth(line)
if columnWidths[i] < width {
columnWidths[i] = width
@@ -148,7 +148,7 @@ func (t *Table) Write(w io.Writer) error {
}
for _, line := range lines {
for i, content := range line {
for _, l := range strings.Split(content, "\n") {
for l := range strings.SplitSeq(content, "\n") {
width := ui.DisplayWidth(l)
if columnWidths[i] < width {
columnWidths[i] = width