MCPcopy Index your code
hub / github.com/cloudfoundry/cli / NewTestUI

Function NewTestUI

util/ui/ui.go:156–175  ·  view source on GitHub ↗

NewTestUI will return a UI object where Out, In, and Err are customizable, and colors are disabled

(in io.Reader, out io.Writer, err io.Writer)

Source from the content-addressed store, hash-verified

154// NewTestUI will return a UI object where Out, In, and Err are customizable,
155// and colors are disabled
156func NewTestUI(in io.Reader, out io.Writer, err io.Writer) *UI {
157 translationFunc, translateErr := generateTranslationFunc([]byte("[]"))
158 if translateErr != nil {
159 panic(translateErr)
160 }
161
162 return &UI{
163 In: in,
164 Out: out,
165 OutForInteraction: out,
166 Err: err,
167 Exiter: realExiter,
168 colorEnabled: configv3.ColorDisabled,
169 translate: translationFunc,
170 Interactor: realInteract,
171 terminalLock: &sync.Mutex{},
172 fileLock: &sync.Mutex{},
173 TimezoneLocation: time.UTC,
174 }
175}
176
177// DeferText translates the template, substitutes in templateValues, and
178// Enqueues the output to be presented later via FlushDeferred. Only the first

Calls 1

generateTranslationFuncFunction · 0.85

Tested by

no test coverage detected