From 16bab1daf17293d6255b4829d7290c84e94da26f Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 2 Dec 2020 10:44:36 -0800 Subject: [PATCH] delete unused code with confusing name collision --- packer-plugin-sdk/packer/ui_mock.go | 41 ----------------------------- 1 file changed, 41 deletions(-) diff --git a/packer-plugin-sdk/packer/ui_mock.go b/packer-plugin-sdk/packer/ui_mock.go index 2e67ffe8b..ca62c184f 100644 --- a/packer-plugin-sdk/packer/ui_mock.go +++ b/packer-plugin-sdk/packer/ui_mock.go @@ -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