Resolve issues identifies by staticcheck

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-02-06 21:49:35 -07:00
parent 3f652ceb02
commit a0179f1432
18 changed files with 895 additions and 1501 deletions

View File

@@ -126,12 +126,12 @@ func FindAllKernels() (kernels collection) {
return kernels
}
func (this *Kernel) version() *version.Version {
return util.ParseVersion(this.Path)
func (kernel *Kernel) version() *version.Version {
return util.ParseVersion(kernel.Path)
}
func (this *Kernel) Version() string {
version := this.version()
func (kernel *Kernel) Version() string {
version := kernel.version()
if version == nil {
return ""
} else {
@@ -139,15 +139,15 @@ func (this *Kernel) Version() string {
}
}
func (this *Kernel) IsDebug() bool {
return strings.Contains(this.Path, "+debug")
func (kernel *Kernel) IsDebug() bool {
return strings.Contains(kernel.Path, "+debug")
}
func (this *Kernel) IsRescue() bool {
return strings.Contains(this.Path, "-rescue")
func (kernel *Kernel) IsRescue() bool {
return strings.Contains(kernel.Path, "-rescue")
}
func (this *Kernel) FullPath() string {
root := image.RootFsDir(this.ImageName)
return filepath.Join(root, this.Path)
func (kernel *Kernel) FullPath() string {
root := image.RootFsDir(kernel.ImageName)
return filepath.Join(root, kernel.Path)
}