checkFileExt 检查文件后缀
(abspath string, exts ...string)
| 24 | |
| 25 | // checkFileExt 检查文件后缀 |
| 26 | func checkFileExt(abspath string, exts ...string) bool { |
| 27 | for _, ext := range exts { |
| 28 | if ext == "" { |
| 29 | continue |
| 30 | } |
| 31 | if strings.HasSuffix(abspath, ext) { |
| 32 | return true |
| 33 | } |
| 34 | } |
| 35 | return false |
| 36 | } |
| 37 | |
| 38 | // checkFileHead 检查文件头 |
| 39 | func checkFileHead(abspath string, ms ...Magic) bool { |