chore: various cosmetic changes.
This commit is contained in:
parent
256d4abde8
commit
aea0034fcc
16 changed files with 35 additions and 32 deletions
|
|
@ -40,7 +40,7 @@ var (
|
|||
systemd bool
|
||||
)
|
||||
|
||||
func aaLog(logger string, path string, profile string, rules bool) error {
|
||||
func aaLog(logger string, path string, profile string) error {
|
||||
var err error
|
||||
var file io.Reader
|
||||
|
||||
|
|
@ -97,8 +97,8 @@ func main() {
|
|||
logger = "systemd"
|
||||
}
|
||||
|
||||
logfile := logs.GetLogFile(path)
|
||||
err := aaLog(logger, logfile, profile, rules)
|
||||
path = logs.SelectLogFile(path)
|
||||
err := aaLog(logger, path, profile)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ func Test_app(t *testing.T) {
|
|||
logger: "auditd",
|
||||
path: "../../tests/audit.log",
|
||||
profile: "",
|
||||
rules: rules,
|
||||
rules: true,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
|
|
@ -60,7 +60,8 @@ func Test_app(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if err := aaLog(tt.logger, tt.path, tt.profile, tt.rules); (err != nil) != tt.wantErr {
|
||||
rules = tt.rules
|
||||
if err := aaLog(tt.logger, tt.path, tt.profile); (err != nil) != tt.wantErr {
|
||||
t.Errorf("aaLog() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue