Skip to content

Commit

Permalink
fixing dashboard on windows - golang/go#45230
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 13, 2023
1 parent 70ca68a commit 7078f78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/pkg/web/handler/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"io/fs"
"net/http"
"os"
"path"
"path/filepath"
"strings"
)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 7078f78

Please # to comment.