aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-04-19 00:53:33 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-04-19 01:01:52 +0200
commit587ac99d26a026c4441ce224f52105d2dbd3751b (patch)
tree83b8d130d03c958e410870e9705204fc3661eb7d /tests
parent23429646da1d07d6a8632263a167f167d9971f35 (diff)
downloadgo-schwift-587ac99d26a026c4441ce224f52105d2dbd3751b.tar.gz
run `go fix ./...`
Diffstat (limited to 'tests')
-rw-r--r--tests/object_iterator_test.go7
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 {