mirror of https://github.com/hashicorp/packer
parent
9ed6fab8c4
commit
b3e361a139
@ -0,0 +1,19 @@
|
||||
package chroot
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/packer/packer"
|
||||
)
|
||||
|
||||
// testUI returns a test ui plus a function to retrieve the errors written to the ui
|
||||
func testUI() (packer.Ui, func() string) {
|
||||
errorBuffer := &strings.Builder{}
|
||||
ui := &packer.BasicUi{
|
||||
Reader: strings.NewReader(""),
|
||||
Writer: ioutil.Discard,
|
||||
ErrorWriter: errorBuffer,
|
||||
}
|
||||
return ui, errorBuffer.String
|
||||
}
|
||||
Loading…
Reference in new issue