mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 09:48:32 -05:00
@@ -234,8 +234,8 @@ func (v *OutputJSON) Output(name string, outputs map[string]*states.OutputValue)
|
||||
return diags
|
||||
}
|
||||
|
||||
v.output.Write(jsonOutput)
|
||||
v.output.Write([]byte("\n"))
|
||||
_, _ = v.output.Write(jsonOutput)
|
||||
_, _ = v.output.Write([]byte("\n"))
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -279,8 +279,8 @@ func (v *OutputJSON) Output(name string, outputs map[string]*states.OutputValue)
|
||||
return diags
|
||||
}
|
||||
|
||||
v.output.Write(jsonOutputs)
|
||||
v.output.Write([]byte("\n"))
|
||||
_, _ = v.output.Write(jsonOutputs)
|
||||
_, _ = v.output.Write([]byte("\n"))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ func (v *ShowJSON) DisplayState(_ context.Context, stateFile *statefile.File, sc
|
||||
v.view.streams.Eprintf("Failed to marshal state to json: %s", err)
|
||||
return 1
|
||||
}
|
||||
v.output.Write(jsonState)
|
||||
_, _ = v.output.Write(jsonState)
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ func (v *ShowJSON) DisplayPlan(_ context.Context, plan *plans.Plan, planJSON *cl
|
||||
v.view.streams.Eprintf("Didn't get external JSON plan format")
|
||||
return 1
|
||||
}
|
||||
v.output.Write(planJSON.JSONBytes)
|
||||
_, _ = v.output.Write(planJSON.JSONBytes)
|
||||
} else if plan != nil {
|
||||
planJSON, err := jsonplan.Marshal(config, plan, priorStateFile, schemas)
|
||||
|
||||
@@ -257,12 +257,12 @@ func (v *ShowJSON) DisplayPlan(_ context.Context, plan *plans.Plan, planJSON *cl
|
||||
v.view.streams.Eprintf("Failed to marshal plan to json: %s", err)
|
||||
return 1
|
||||
}
|
||||
v.output.Write(planJSON)
|
||||
_, _ = v.output.Write(planJSON)
|
||||
} else {
|
||||
// Should not get here because at least one of the two plan arguments
|
||||
// should be present, but we'll tolerate this by just returning an
|
||||
// empty JSON object.
|
||||
v.output.Write([]byte("{}"))
|
||||
_, _ = v.output.Write([]byte("{}"))
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -273,7 +273,7 @@ func (v *ShowJSON) DisplayConfig(config *configs.Config, schemas *tofu.Schemas)
|
||||
v.view.streams.Eprintf("Failed to marshal configuration to JSON: %s", err)
|
||||
return 1
|
||||
}
|
||||
v.output.Write(configJSON)
|
||||
_, _ = v.output.Write(configJSON)
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ func (v *ShowJSON) DisplaySingleModule(module *configs.Module) int {
|
||||
v.view.streams.Eprintf("Failed to marshal module contents to JSON: %s", err)
|
||||
return 1
|
||||
}
|
||||
v.output.Write(moduleJSON)
|
||||
_, _ = v.output.Write(moduleJSON)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ func (v *StateLockerJSON) Locking() {
|
||||
|
||||
lock_info_message, _ := json.Marshal(json_data)
|
||||
lock_info_message = append(lock_info_message, '\n')
|
||||
v.output.Write(lock_info_message)
|
||||
_, _ = v.output.Write(lock_info_message)
|
||||
}
|
||||
|
||||
func (v *StateLockerJSON) Unlocking() {
|
||||
@@ -107,5 +107,5 @@ func (v *StateLockerJSON) Unlocking() {
|
||||
|
||||
lock_info_message, _ := json.Marshal(json_data)
|
||||
lock_info_message = append(lock_info_message, '\n')
|
||||
v.output.Write(lock_info_message)
|
||||
_, _ = v.output.Write(lock_info_message)
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ func (v *ValidateJSON) Results(diags tfdiags.Diagnostics) int {
|
||||
// Should never happen because we fully-control the input here
|
||||
panic(err)
|
||||
}
|
||||
v.output.Write(j)
|
||||
_, _ = v.output.Write(j)
|
||||
|
||||
if diags.HasErrors() {
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user