From f22acf38da970aa0d865a9978c9499dad01d235f Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Mon, 20 Jun 2022 22:21:28 -0700 Subject: Convert hardcoded path separators to filepath.Join --- hotline/file_transfer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hotline/file_transfer.go') diff --git a/hotline/file_transfer.go b/hotline/file_transfer.go index 4a93390..90dbbe6 100644 --- a/hotline/file_transfer.go +++ b/hotline/file_transfer.go @@ -3,7 +3,7 @@ package hotline import ( "encoding/binary" "fmt" - "strings" + "path/filepath" ) // File transfer types @@ -51,11 +51,12 @@ func (fu *folderUpload) FormattedPath() string { var pathSegments []string pathData := fu.FileNamePath + // TODO: implement scanner interface instead? for i := uint16(0); i < pathItemLen; i++ { segLen := pathData[2] pathSegments = append(pathSegments, string(pathData[3:3+segLen])) pathData = pathData[3+segLen:] } - return strings.Join(pathSegments, pathSeparator) + return filepath.Join(pathSegments...) } -- cgit