Skip to content

Commit

Permalink
fix: always remove trailing /
Browse files Browse the repository at this point in the history
  • Loading branch information
likeazir committed Oct 7, 2023
1 parent 092c5c5 commit f6f1724
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/pkg/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 5 additions & 1 deletion internal/pkg/fsclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit f6f1724

Please sign in to comment.