MCPcopy
hub / github.com/opentofu/opentofu / NewView

Function NewView

internal/command/views/view.go:61–78  ·  view source on GitHub ↗

Initialize a View with the given streams, a disabled colorize object, and a no-op configSources callback.

(streams *terminal.Streams)

Source from the content-addressed store, hash-verified

59// Initialize a View with the given streams, a disabled colorize object, and a
60// no-op configSources callback.
61func NewView(streams *terminal.Streams) *View {
62 return &View{
63 streams: streams,
64 colorize: &colorstring.Colorize{
65 Colors: colorstring.DefaultColors,
66 Disable: true,
67 Reset: true,
68 },
69 configSources: func() map[string]*hcl.File { return nil },
70 diagsPrinter: func(severity tfdiags.Severity, msg string) {
71 if severity == tfdiags.Error {
72 _, _ = streams.Eprint(msg)
73 } else {
74 _, _ = streams.Print(msg)
75 }
76 },
77 }
78}
79
80// SetRunningInAutomation modifies the view's "running in automation" flag,
81// which causes some slight adjustments to certain messages that would normally

Calls 2

EprintMethod · 0.80
PrintMethod · 0.80