From 7078f784c4ebc7f05c99b1a1b612096c845689b1 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 13 Sep 2023 11:31:11 -0700 Subject: [PATCH] fixing dashboard on windows - https://github.com/golang/go/issues/45230 --- backend/pkg/web/handler/dashboard.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/pkg/web/handler/dashboard.go b/backend/pkg/web/handler/dashboard.go index 8551076b..8ff0ffa8 100644 --- a/backend/pkg/web/handler/dashboard.go +++ b/backend/pkg/web/handler/dashboard.go @@ -15,6 +15,7 @@ import ( "io/fs" "net/http" "os" + "path" "path/filepath" "strings" ) @@ -169,7 +170,7 @@ func AddDashboardLocation(c *gin.Context) { return } -//private functions +// private functions func getCacheDir(appConfig config.Interface, currentUserId string) (string, error) { // initialize the cache directory cacheDir := filepath.Join(appConfig.GetString("cache.location"), currentUserId, "dashboard") @@ -269,7 +270,8 @@ func getDashboardFromDir(parentDir string, dirEntries []fs.DirEntry, fsReadFile } //unmarshal file into map - embeddedFile, err := fsReadFile(filepath.Join(parentDir, file.Name())) + //have to use path (not filepath.Join) because of https://github.com/golang/go/issues/45230 + embeddedFile, err := fsReadFile(path.Join(parentDir, file.Name())) if err != nil { return nil, err }