diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-04-19 00:53:33 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-04-19 01:01:52 +0200 |
| commit | 587ac99d26a026c4441ce224f52105d2dbd3751b (patch) | |
| tree | 83b8d130d03c958e410870e9705204fc3661eb7d /tests/object_iterator_test.go | |
| parent | 23429646da1d07d6a8632263a167f167d9971f35 (diff) | |
| download | go-schwift-587ac99d26a026c4441ce224f52105d2dbd3751b.tar.gz | |
run `go fix ./...`
Diffstat (limited to 'tests/object_iterator_test.go')
| -rw-r--r-- | tests/object_iterator_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/object_iterator_test.go b/tests/object_iterator_test.go index ac10dbc..592d896 100644 --- a/tests/object_iterator_test.go +++ b/tests/object_iterator_test.go @@ -246,8 +246,7 @@ func expectObjectInfos(t *testing.T, actualInfos []schwift.ObjectInfo, expectedN } for idx, info := range actualInfos { // case 1: pseudo-directory - if strings.HasPrefix(expectedNames[idx], "subdir:") { - expectedSubdir := strings.TrimPrefix(expectedNames[idx], "subdir:") + if expectedSubdir, ok := strings.CutPrefix(expectedNames[idx], "subdir:"); ok { if expectedSubdir != info.SubDirectory { t.Errorf("expected objects[%d] subdir = %q, got %q", idx, expectedSubdir, info.SubDirectory) @@ -264,8 +263,8 @@ func expectObjectInfos(t *testing.T, actualInfos []schwift.ObjectInfo, expectedN } // case 2: symlink - if strings.HasPrefix(expectedNames[idx], "symlink:") { - fields := strings.SplitN(strings.TrimPrefix(expectedNames[idx], "symlink:"), ">", 2) + if after, ok := strings.CutPrefix(expectedNames[idx], "symlink:"); ok { + fields := strings.SplitN(after, ">", 2) expectedName, expectedTargetName := fields[0], fields[1] if info.Object == nil { |
