From bea4f87f1e4528630d326699a9c7fd6133ee7806 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Thu, 9 Sep 2021 18:55:06 +0200 Subject: better commit and restore tests (almost complete) added some file path management function for prfixes and trailing slash --- utils/fileutils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 utils/fileutils.go (limited to 'utils/fileutils.go') diff --git a/utils/fileutils.go b/utils/fileutils.go new file mode 100644 index 0000000..6c269ca --- /dev/null +++ b/utils/fileutils.go @@ -0,0 +1,10 @@ +package utils + +import ( + "path/filepath" + "strings" +) + +func TrimTrailingSeparator(path string) string { + return strings.TrimSuffix(path, string(filepath.Separator)) +} -- cgit v1.2.3