delete unused code with confusing name collision

This commit is contained in:
Megan Marsh 2020-12-02 10:44:36 -08:00
parent a0e81806d3
commit 16bab1daf1
1 changed files with 0 additions and 41 deletions

View File

@ -1,50 +1,9 @@
package packer
import (
"errors"
"io"
"log"
"strings"
)
// TestUi is a UI that only outputs unformatted output to the given writer.
type TestUi struct {
Writer io.Writer
}
var _ Ui = new(TestUi)
func (u *TestUi) Ask(query string) (string, error) {
return "", errors.New("Test UI can't ask")
}
func (u *TestUi) Say(message string) {
log.Printf(message)
}
func (u *TestUi) Message(message string) {
log.Printf(message)
}
func (u *TestUi) Error(message string) {
log.Printf(message)
}
func (u *TestUi) Machine(message string, args ...string) {
log.Printf("%s, %s", message, strings.Join(args, ", "))
}
func (u *TestUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) {
return &readCloser{
read: func(p []byte) (int, error) {
return stream.Read(p)
},
close: func() error {
return stream.Close()
},
}
}
type MockUi struct {
AskCalled bool
AskQuery string