remove RevertFiles function

This commit is contained in:
Shawn Smith
2022-03-26 18:57:39 +09:00
parent a7a96b4141
commit 9eb5ac8a26
2 changed files with 1 additions and 15 deletions

View File

@@ -49,9 +49,8 @@ func Run(dir string) (ChecksResult, error) {
err = RenameFiles(skipped)
if err != nil {
log.Println("Could not remove files:", err)
log.Println("Could not rename files:", err)
}
defer RevertFiles(skipped)
checks := []Check{
GoFmt{Dir: dir, Filenames: filenames},

View File

@@ -82,19 +82,6 @@ func RenameFiles(names []string) (err error) {
return err
}
// RevertFiles removes the ".grc.bk" extension from files
func RevertFiles(names []string) (err error) {
for i := range names {
tmpErr := os.Rename(names[i]+".grc.bk", names[i])
if tmpErr != nil {
// save this error, but still continue with other files
err = tmpErr
}
}
return err
}
// lineCount returns the number of lines in a given file
func lineCount(filepath string) (int, error) {
out, err := exec.Command("wc", "-l", filepath).Output()