aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/internal/turbopath/relative_unix_path.go
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:55 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:55 +0800
commitfc8c5fdce62fb229202659408798a7b6c98f6e8b (patch)
tree7554f80e50de4af6fd255afa7c21bcdd58a7af34 /cli/internal/turbopath/relative_unix_path.go
parentdd84b9d64fb98746a230cd24233ff50a562c39c9 (diff)
downloadHydroRoll-fc8c5fdce62fb229202659408798a7b6c98f6e8b.tar.gz
HydroRoll-fc8c5fdce62fb229202659408798a7b6c98f6e8b.zip
Diffstat (limited to 'cli/internal/turbopath/relative_unix_path.go')
-rw-r--r--cli/internal/turbopath/relative_unix_path.go31
1 files changed, 0 insertions, 31 deletions
diff --git a/cli/internal/turbopath/relative_unix_path.go b/cli/internal/turbopath/relative_unix_path.go
deleted file mode 100644
index 05829e2..0000000
--- a/cli/internal/turbopath/relative_unix_path.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package turbopath
-
-import (
- "path"
- "path/filepath"
-)
-
-// RelativeUnixPath is a relative path using Unix `/` separators.
-type RelativeUnixPath string
-
-// ToString returns a string represenation of this Path.
-// Used for interfacing with APIs that require a string.
-func (p RelativeUnixPath) ToString() string {
- return string(p)
-}
-
-// ToSystemPath converts a RelativeUnixPath to a RelativeSystemPath.
-func (p RelativeUnixPath) ToSystemPath() RelativeSystemPath {
- return RelativeSystemPath(filepath.FromSlash(p.ToString()))
-}
-
-// ToUnixPath converts a RelativeUnixPath to a RelativeSystemPath.
-func (p RelativeUnixPath) ToUnixPath() RelativeUnixPath {
- return p
-}
-
-// Join appends relative path segments to this RelativeUnixPath.
-func (p RelativeUnixPath) Join(additional ...RelativeUnixPath) RelativeUnixPath {
- cast := RelativeUnixPathArray(additional)
- return RelativeUnixPath(path.Join(p.ToString(), path.Join(cast.ToStringArray()...)))
-}