1 Star 0 Fork 0

mayun / packr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
clean.go 582 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mark Bates 提交于 2017-09-13 18:01 . added the ability to ignore boxes
package builder
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/pkg/errors"
)
// Clean up an *-packr.go files
func Clean(root string) {
filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
base := filepath.Base(path)
if base == ".git" || base == "vendor" || base == "node_modules" {
return filepath.SkipDir
}
if info == nil || info.IsDir() {
return nil
}
if strings.Contains(base, "-packr.go") {
err := os.Remove(path)
if err != nil {
fmt.Println(err)
return errors.WithStack(err)
}
}
return nil
})
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mayun562/packr.git
git@gitee.com:mayun562/packr.git
mayun562
packr
packr
v1.10.0

搜索帮助

344bd9b3 5694891 D2dac590 5694891