1 Star 0 Fork 0

庸人妄语/msgo

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
decompress.go 523 Bytes
一键复制 编辑 原始数据 按行查看 历史
庸人妄语 提交于 2023-08-18 08:48 +08:00 . 2023.8.17
package archive
import (
"path"
"strings"
mstar "gitee.com/yrwy/msgo/pkg/archive/tar"
mszip "gitee.com/yrwy/msgo/pkg/archive/zip"
"gitee.com/yrwy/msgo/pkg/errors"
)
func Decompress(src string, destDir string) ([]string, error) {
ext := path.Ext(src)
if strings.EqualFold(ext, ".zip") {
return mszip.Decompress(src, destDir)
}
if strings.EqualFold(ext, ".tar") || (len(src) > 7 && strings.EqualFold(src[len(src)-7:], ".tar.gz")) {
return mstar.Decompress(src, destDir)
}
return nil, errors.ErrNotSupport
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/yrwy/msgo.git
git@gitee.com:yrwy/msgo.git
yrwy
msgo
msgo
v0.2.5

搜索帮助