diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-20 22:21:28 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-20 22:21:28 -0700 |
| commit | f22acf38da970aa0d865a9978c9499dad01d235f (patch) | |
| tree | 6811766749c794afd9eb23e372cc1673f1bae41a /hotline/file_path.go | |
| parent | 7cd900d61edbd6d322db3cecb913adf574389320 (diff) | |
Convert hardcoded path separators to filepath.Join
Diffstat (limited to 'hotline/file_path.go')
| -rw-r--r-- | hotline/file_path.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/hotline/file_path.go b/hotline/file_path.go index cdd95b9..c8fe652 100644 --- a/hotline/file_path.go +++ b/hotline/file_path.go @@ -5,12 +5,10 @@ import ( "encoding/binary" "errors" "io" - "path" + "path/filepath" "strings" ) -const pathSeparator = "/" // File path separator TODO: make configurable to support Windows - // FilePathItem represents the file or directory portion of a delimited file path (e.g. foo and bar in "/foo/bar") // 00 00 // 09 @@ -84,7 +82,7 @@ func (fp *FilePath) String() string { out = append(out, string(i.Name)) } - return path.Join(out...) + return filepath.Join(out...) } func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err error) { @@ -95,11 +93,11 @@ func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err } } - fullPath = path.Join( + fullPath = filepath.Join( "/", fileRoot, fp.String(), - path.Join("/", string(fileName)), + filepath.Join("/", string(fileName)), ) return fullPath, nil |