From f6f1724d9cdae767a9b2b8d2cca41399373d48b0 Mon Sep 17 00:00:00 2001 From: likeazir Date: Sat, 7 Oct 2023 11:53:45 +0200 Subject: [PATCH] fix: always remove trailing / --- internal/pkg/common/types.go | 6 +++++- internal/pkg/fsclient/client.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/pkg/common/types.go b/internal/pkg/common/types.go index 2f83ca0..8121e65 100644 --- a/internal/pkg/common/types.go +++ b/internal/pkg/common/types.go @@ -123,5 +123,9 @@ func (l LocalPath) Append(name string) LocalPath { } func (l LocalPath) String() string { - return string(l) + str := string(l) + if str[:len(str)-1] == "/" { + return str[:len(str)-1] + } + return str } diff --git a/internal/pkg/fsclient/client.go b/internal/pkg/fsclient/client.go index f4c3349..97d0f43 100644 --- a/internal/pkg/fsclient/client.go +++ b/internal/pkg/fsclient/client.go @@ -110,5 +110,9 @@ func (r RemotePath) Append(name string) RemotePath { } func (r RemotePath) String() string { - return string(r) + str := string(r) + if str[:len(str)-1] == "/" { + return str[:len(str)-1] + } + return str }