init: 自 zomaintain/backend/remote-core 平移独立成库; module path 改为 git.zeroonesoft.cn/golib/remote-core; 修复 ResizeDataType 未导出字段致 json tag 无效的遗留问题
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// 通用小工具(自 remote-backend-server internal/libs/common 裁剪)。
|
||||
|
||||
package common
|
||||
|
||||
import "os"
|
||||
|
||||
// PathExists 路径是否存在。
|
||||
func PathExists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
Reference in New Issue
Block a user