chore: apply some linter recommendations.

This commit is contained in:
Alexandre Pujol 2025-04-04 23:45:24 +02:00
parent 3b6b50cf63
commit 984cf28e61
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
37 changed files with 125 additions and 126 deletions

View file

@ -181,7 +181,7 @@ func (r *Mount) Merge(other Rule) bool {
o, _ := other.(*Mount)
mc := &r.MountConditions
if !r.Qualifier.Equal(o.Qualifier) {
if !r.Equal(o.Qualifier) {
return false
}
if r.Source == o.Source && r.MountPoint == o.MountPoint &&
@ -194,10 +194,10 @@ func (r *Mount) Merge(other Rule) bool {
func (r *Mount) Lengths() []int {
return []int{
r.Qualifier.getLenAudit(),
r.Qualifier.getLenAccess(),
r.MountConditions.getLenFsType(),
r.MountConditions.getLenOptions(),
r.getLenAudit(),
r.getLenAccess(),
r.getLenFsType(),
r.getLenOptions(),
length("", r.Source),
length("", r.MountPoint),
}
@ -278,7 +278,7 @@ func (r *Umount) Merge(other Rule) bool {
o, _ := other.(*Umount)
mc := &r.MountConditions
if !r.Qualifier.Equal(o.Qualifier) {
if !r.Equal(o.Qualifier) {
return false
}
if r.MountPoint == o.MountPoint && mc.Merge(o.MountConditions) {
@ -290,10 +290,10 @@ func (r *Umount) Merge(other Rule) bool {
func (r *Umount) Lengths() []int {
return []int{
r.Qualifier.getLenAudit(),
r.Qualifier.getLenAccess(),
r.MountConditions.getLenFsType(),
r.MountConditions.getLenOptions(),
r.getLenAudit(),
r.getLenAccess(),
r.getLenFsType(),
r.getLenOptions(),
length("", r.MountPoint),
}
}
@ -374,7 +374,7 @@ func (r *Remount) Merge(other Rule) bool {
o, _ := other.(*Remount)
mc := &r.MountConditions
if !r.Qualifier.Equal(o.Qualifier) {
if !r.Equal(o.Qualifier) {
return false
}
if r.MountPoint == o.MountPoint && mc.Merge(o.MountConditions) {
@ -386,10 +386,10 @@ func (r *Remount) Merge(other Rule) bool {
func (r *Remount) Lengths() []int {
return []int{
r.Qualifier.getLenAudit(),
r.Qualifier.getLenAccess(),
r.MountConditions.getLenFsType(),
r.MountConditions.getLenOptions(),
r.getLenAudit(),
r.getLenAccess(),
r.getLenFsType(),
r.getLenOptions(),
length("", r.MountPoint),
}
}