fix ineffectual assignments found by golangci-lint

This commit is contained in:
Ondřej Budai 2020-02-14 10:19:28 +01:00 committed by Tom Gundersen
parent 55d3854033
commit 3ff88c336f
4 changed files with 10 additions and 4 deletions

View file

@ -549,7 +549,7 @@ func (r *Fedora30) firewallStageOptions(firewall *blueprint.FirewallCustomizatio
func (r *Fedora30) systemdStageOptions(enabledServices, disabledServices []string, s *blueprint.ServicesCustomization) *pipeline.SystemdStageOptions {
if s != nil {
enabledServices = append(enabledServices, s.Enabled...)
enabledServices = append(disabledServices, s.Disabled...)
disabledServices = append(disabledServices, s.Disabled...)
}
return &pipeline.SystemdStageOptions{
EnabledServices: enabledServices,

View file

@ -441,7 +441,6 @@ func (r *RHEL82) Name() string {
return name
}
func (r *RHEL82) Distribution() common.Distribution {
return Distro
}
@ -692,7 +691,7 @@ func (r *RHEL82) firewallStageOptions(firewall *blueprint.FirewallCustomization)
func (r *RHEL82) systemdStageOptions(enabledServices, disabledServices []string, s *blueprint.ServicesCustomization, target string) *pipeline.SystemdStageOptions {
if s != nil {
enabledServices = append(enabledServices, s.Enabled...)
enabledServices = append(disabledServices, s.Disabled...)
disabledServices = append(disabledServices, s.Disabled...)
}
return &pipeline.SystemdStageOptions{
EnabledServices: enabledServices,

View file

@ -132,6 +132,9 @@ func (a *AWS) Register(name, bucket, key string) (*string, error) {
},
},
)
if err != nil {
return nil, err
}
snapshotId := importOutput.ImportSnapshotTasks[0].SnapshotTaskDetail.SnapshotId

View file

@ -43,13 +43,17 @@ func generateRandomFile(pattern string, length int) (string, []byte, error) {
cmd := exec.Command("dd", "bs=1", countArg, "if=/dev/urandom", fmt.Sprintf("of=%s", fileName))
err = cmd.Run()
if err != nil {
return "", []byte{}, err
}
contents, err := ioutil.ReadAll(f)
if err != nil {
return "", []byte{}, err
}
if err := f.Close(); err != nil {
return ",", []byte{}, err
return "", []byte{}, err
}
return fileName, contents, err