优化导入文档中链接处理

This commit is contained in:
lifei6671
2018-07-23 09:54:00 +08:00
parent e729e35abb
commit 94faf856f7
2 changed files with 27 additions and 7 deletions

View File

@@ -151,12 +151,16 @@ func AbsolutePath(p string) (string, error) {
}
// FileExists reports whether the named file or directory exists.
func FileExists(name string) bool {
if _, err := os.Stat(name); err != nil {
return false
}else{
func FileExists(path string) bool {
_, err := os.Stat(path)
if err == nil {
return true
}
if os.IsNotExist(err) {
return false
}
return false
}
func FormatBytes(size int64) string {