From 587ac99d26a026c4441ce224f52105d2dbd3751b Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Sun, 19 Apr 2026 00:53:33 +0200 Subject: run `go fix ./...` --- tests/object_iterator_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/object_iterator_test.go') 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 { -- cgit v1.2.3