修复gspath模块是windows下搜索失效问题

This commit is contained in:
John
2018-11-18 19:14:17 +08:00
parent 6addd64cf0
commit 04608269fe
2 changed files with 3 additions and 2 deletions

View File

@ -44,6 +44,8 @@
1. 改进gfpool在文件指针变化时的更新
1. gtcp提供简便的包发送/接收方法(SendPkg/RecvPkg)以解决常见的TCP通信粘包问题并完善文档参考https://www.cnblogs.com/kex1n/p/6502002.html
1. gfile对于文件的读写强行使用了gfpool在某些场景下不合适需要考虑剥离开并为开发者提供单独的指针池文件操作特性
1. gcfg/gview/ghttp等模块加上对临时文件目录的自动添加监听判断基本是开发环境下特别是windows环境去掉临时文件的监听避免临时文件过大引起的运行缓慢占用内存问题
# DONE

View File

@ -164,11 +164,10 @@ func (sp *SPath) updateCacheByPath(path string) {
// 格式化name返回符合规范的缓存名称分隔符号统一为'/',且前缀必须以'/'开头(类似HTTP URI).
func (sp *SPath) formatCacheName(name string) string {
name = strings.Trim(name, "./")
if runtime.GOOS != "linux" {
name = gstr.Replace(name, "\\", "/")
}
return "/" + name
return "/" + strings.Trim(name, "./")
}
// 根据path计算出对应的缓存name