Skip to content
This repository was archived by the owner on Sep 24, 2022. It is now read-only.

Commit 9663426

Browse files
authored
Fix bug for system like windows (#58)
1 parent 2887930 commit 9663426

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

assets/assets.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ type Assets struct {
2020
}
2121

2222
func (a Assets) GetImage(imageName string) image.Image {
23-
return a.imageMap[imageName]
23+
return a.imageMap[convertPath(imageName)]
2424
}
2525

2626
func (a Assets) GetAudio(audioName string) audio.Audio {
27-
return a.audioMap[audioName]
27+
return a.audioMap[convertPath(audioName)]
28+
}
29+
30+
func convertPath(path string) string {
31+
parts := strings.Split(path, "/")
32+
return filepath.Join(parts...)
2833
}
2934

3035
func LoadAssets(assetRootDir string) (Assets, error) {

0 commit comments

Comments
 (0)