1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 22:52:29 +08:00

feat: add IsZipFile

This commit is contained in:
dudaodong
2023-04-24 11:00:58 +08:00
parent aaf45012e4
commit 5e79eaa9dd
6 changed files with 95 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ import (
- [ReadFileByLine](#ReadFileByLine)
- [Zip](#Zip)
- [UnZip](#UnZip)
- [UnZip](#UnZip)
- [IsZipFile](#IsZipFile)
<div STYLE="page-break-after: always;"></div>
@@ -496,3 +496,30 @@ func main() {
}
}
```
### <span id="IsZipFile">IsZipFile</span>
<p>Checks if file is zip file or not.</p>
<b>Signature:</b>
```go
func IsZipFile(filepath string) bool
```
<b>Example:</b>
```go
package main
import (
"fmt"
"github.com/duke-git/lancet/v2/fileutil"
)
func main() {
isZip := IsZipFile("./zipfile.zip")
fmt.Println(isZip)
}
```