]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/file_path.go
Convert hardcoded path separators to filepath.Join
[rbdr/mobius] / hotline / file_path.go
index cdd95b9a33149f588378cec2c2014574dea4d108..c8fe652e878aa559e67bae2e9d3d59a1f89a4d35 100644 (file)
@@ -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