Files
opentf/internal/command/views/root.go
Andrei Ciobanu ce59943d99 Remove Ui from the Meta structure (#4000)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2026-04-07 13:38:46 -04:00

27 lines
641 B
Go

// Copyright (c) The OpenTofu Authors
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package views
import "github.com/opentofu/opentofu/internal/tfdiags"
// Root is the view that is meant to be used strictly during the initialisation of the process
// and offers methods to print errors as raw as possible.
type Root struct {
view *View
}
func NewRoot(view *View) *Root {
return &Root{view: view}
}
func (v *Root) Error(msg string) {
_, _ = v.view.streams.Eprintln(msg)
}
func (v *Root) Diagnostics(diagnostics tfdiags.Diagnostics) {
v.view.Diagnostics(diagnostics)
}