aboutsummaryrefslogtreecommitdiff
path: root/internal/rtree/shared_test.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2025-09-29 21:48:35 +0200
committerStefan Majewsky <majewsky@gmx.net>2025-09-29 21:48:35 +0200
commitfa24620c50a56ae6c3c31575e861098d0f0ed177 (patch)
treee6963f607605577ca06dfeff666e5a186bb2b15f /internal/rtree/shared_test.go
parent24762f09de2aa8cada3f3c63afa313e06ebf47c8 (diff)
downloadgofu-fa24620c50a56ae6c3c31575e861098d0f0ed177.tar.gz
run `modernize -fix ./...`
Also drop util/gocovcat.go which has been obsolete since 122068efd4a348921b736b4456d4e1c999dbfb79.
Diffstat (limited to 'internal/rtree/shared_test.go')
-rw-r--r--internal/rtree/shared_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/rtree/shared_test.go b/internal/rtree/shared_test.go
index e26eb11..0a5e2df 100644
--- a/internal/rtree/shared_test.go
+++ b/internal/rtree/shared_test.go
@@ -146,8 +146,8 @@ func Recorded(lines ...string) (cs []RecordedCommand) {
cs = make([]RecordedCommand, len(lines))
for idx, line := range lines {
cmdline := strings.Fields(line)
- if strings.HasPrefix(cmdline[0], "@") {
- cs[idx].Cmd.WorkDir = strings.TrimPrefix(cmdline[0], "@")
+ if workDir, ok := strings.CutPrefix(cmdline[0], "@"); ok {
+ cs[idx].Cmd.WorkDir = workDir
cmdline = cmdline[1:]
}
cs[idx].Cmd.Program = cmdline