distro: Fix bug found by linting
Using new() to create a new struct assigns an empty struct to the variable, meaning it can never be tested for nil. This means this code would never detect a missing kernel package.
This commit is contained in:
parent
826e9d8cc6
commit
cf18e2990a
2 changed files with 2 additions and 2 deletions
|
|
@ -238,7 +238,7 @@ func imageInstallerPipelines(t *imageType, customizations *blueprint.Customizati
|
|||
}
|
||||
pipelines = append(pipelines, *treePipeline)
|
||||
|
||||
kernelPkg := new(rpmmd.PackageSpec)
|
||||
var kernelPkg *rpmmd.PackageSpec
|
||||
installerPackages := packageSetSpecs[installerPkgsKey]
|
||||
for _, pkg := range installerPackages {
|
||||
if pkg.Name == "kernel" {
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ func imageInstallerPipelines(t *imageType, customizations *blueprint.Customizati
|
|||
}
|
||||
pipelines = append(pipelines, *treePipeline)
|
||||
|
||||
kernelPkg := new(rpmmd.PackageSpec)
|
||||
var kernelPkg *rpmmd.PackageSpec
|
||||
installerPackages := packageSetSpecs[installerPkgsKey]
|
||||
for _, pkg := range installerPackages {
|
||||
if pkg.Name == "kernel" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue