github地址:github.com/gen2brain/go-unarr
使用很方便,解压例子如下:
func ExtractFile(file string) error {
a, err := unarr.NewArchive(file)
if err != nil {
return err
}
defer a.Close()
dpath, _ := FileNameAndType(file)
println("extractPath:", dpath)
_, err = a.Extract(dpath)
return err
}
支持 RAR,TAR,ZIP,7Z