This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git
The following commit(s) were added to refs/heads/main by this push:
new 126ce2b Fix compatibility issues in Windows (#44)
126ce2b is described below
commit 126ce2b4360bce2f05d87344736f4b17e6e90f31
Author: Youhan Wu <[email protected]>
AuthorDate: Sat Jul 17 01:21:39 2021 +0800
Fix compatibility issues in Windows (#44)
---
assets/assets.go | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/assets/assets.go b/assets/assets.go
index 7332988..bd7c9b9 100644
--- a/assets/assets.go
+++ b/assets/assets.go
@@ -21,15 +21,16 @@ package assets
import (
"embed"
"io/fs"
+ "path/filepath"
)
//go:embed *
var assets embed.FS
func Asset(file string) ([]byte, error) {
- return assets.ReadFile(file)
+ return assets.ReadFile(filepath.ToSlash(file))
}
func AssetDir(dir string) ([]fs.DirEntry, error) {
- return assets.ReadDir(dir)
+ return assets.ReadDir(filepath.ToSlash(dir))
}