fix static check errors

This commit is contained in:
CJ Horton 2023-05-30 18:00:41 -07:00
parent b705414d6b
commit 6ca13bfc1e
3 changed files with 4 additions and 7 deletions

View File

@ -560,7 +560,7 @@ func shouldRenderPlan(run *tfe.Run) bool {
func shouldGenerateConfig(out string, run *tfe.Run) bool {
return (run.Plan.Status == tfe.PlanErrored || run.Plan.Status == tfe.PlanFinished) &&
run.Plan.GeneratedConfiguration == true && len(out) > 0
run.Plan.GeneratedConfiguration && len(out) > 0
}
const planDefaultHeader = `

View File

@ -1044,7 +1044,7 @@ func (m *MockRuns) Create(ctx context.Context, options tfe.RunCreateOptions) (*t
r.RefreshOnly = *options.RefreshOnly
}
if options.AllowConfigGeneration != nil && *options.AllowConfigGeneration == true {
if options.AllowConfigGeneration != nil && *options.AllowConfigGeneration {
r.Plan.GeneratedConfiguration = true
}

View File

@ -9,11 +9,8 @@ import (
)
func ShouldWriteConfig(out string) bool {
if len(out) == 0 {
// No specified out file, so don't write anything.
return false
}
return true
// No specified out file, so don't write anything.
return len(out) != 0
}
func ValidateTargetFile(out string) (diags tfdiags.Diagnostics) {