refactor: remove HandleFile method

pull/7/head
sundowndev 2022-11-17 17:35:21 +04:00
parent 5f20de76b9
commit a3eab6ef82
4 changed files with 0 additions and 28 deletions

View File

@ -3,7 +3,6 @@ package check
import ( import (
"fmt" "fmt"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/sundowndev/covermyass/v2/lib/find"
"os" "os"
) )
@ -31,10 +30,6 @@ func (s *shellHistoryCheck) Paths() []string {
} }
} }
func (s *shellHistoryCheck) HandleFile(file find.FileInfo) error {
return os.Truncate(file.Path(), 0)
}
func init() { func init() {
AddCheck(NewShellHistoryCheck()) AddCheck(NewShellHistoryCheck())
} }

View File

@ -1,9 +1,5 @@
package check package check
import (
"github.com/sundowndev/covermyass/v2/lib/find"
)
const ( const (
Linux = "linux" Linux = "linux"
Darwin = "darwin" Darwin = "darwin"
@ -15,7 +11,6 @@ var checks []Check
type Check interface { type Check interface {
Name() string Name() string
Paths() []string Paths() []string
HandleFile(find.FileInfo) error
} }
func GetAllChecks() []Check { func GetAllChecks() []Check {

View File

@ -2,11 +2,6 @@
package check package check
import (
"github.com/sundowndev/covermyass/v2/lib/find"
"os"
)
type lastLogCheck struct{} type lastLogCheck struct{}
func NewLastLogCheck() Check { func NewLastLogCheck() Check {
@ -23,10 +18,6 @@ func (s *lastLogCheck) Paths() []string {
} }
} }
func (s *lastLogCheck) HandleFile(file find.FileInfo) error {
return os.Truncate(file.Path(), 0)
}
func init() { func init() {
AddCheck(NewLastLogCheck()) AddCheck(NewLastLogCheck())
} }

View File

@ -2,11 +2,6 @@
package check package check
import (
"github.com/sundowndev/covermyass/v2/lib/find"
"os"
)
type sshdCheck struct{} type sshdCheck struct{}
func NewSSHdCheck() Check { func NewSSHdCheck() Check {
@ -23,10 +18,6 @@ func (s *sshdCheck) Paths() []string {
} }
} }
func (s *sshdCheck) HandleFile(file find.FileInfo) error {
return os.Truncate(file.Path(), 0)
}
func init() { func init() {
AddCheck(NewSSHdCheck()) AddCheck(NewSSHdCheck())
} }