From c5e15e74bb6b676f8764228dc62f0bb1c5b73e38 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Sat, 18 Aug 2018 23:30:28 -0500 Subject: [PATCH] gofmt -w on all this stuff. --- common/progress.go | 6 +++--- common/progress_test.go | 12 ++++++------ common/terminal_posix.go | 2 +- common/terminal_windows.go | 1 - packer/rpc/ui_test.go | 22 +++++++++++----------- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/common/progress.go b/common/progress.go index 60f1b8b2e20..6ab12dcd3e1 100644 --- a/common/progress.go +++ b/common/progress.go @@ -2,10 +2,10 @@ package common import ( "fmt" - "log" - "time" "github.com/cheggaaa/pb" "github.com/hashicorp/packer/packer" + "log" + "time" ) // The ProgressBar interface is used for abstracting cheggaaa's progress- @@ -86,7 +86,7 @@ func calculateUiPrefixLength(ui packer.Ui) int { const targetedArrowText = "==>" u := ui.(*packer.TargetedUI) res := fmt.Sprintf("%s %s: ", targetedArrowText, u.Target) - return recursiveCalculateUiPrefixLength(u.Ui, agg + len(res)) + return recursiveCalculateUiPrefixLength(u.Ui, agg+len(res)) case *packer.BasicUi: // The standard BasicUi appends only a newline diff --git a/common/progress_test.go b/common/progress_test.go index 56ab933c585..a9b74639b70 100644 --- a/common/progress_test.go +++ b/common/progress_test.go @@ -1,19 +1,19 @@ package common import ( - "testing" "github.com/hashicorp/packer/packer" + "testing" ) // test packer.Ui implementation to verify that progress bar is being written type testProgressBarUi struct { - messageCalled bool - messageMessage string + messageCalled bool + messageMessage string } -func (u *testProgressBarUi) Say(string) { } -func (u *testProgressBarUi) Error(string) { } -func (u *testProgressBarUi) Machine(string, ...string) { } +func (u *testProgressBarUi) Say(string) {} +func (u *testProgressBarUi) Error(string) {} +func (u *testProgressBarUi) Machine(string, ...string) {} func (u *testProgressBarUi) Ask(string) (string, error) { return "", nil diff --git a/common/terminal_posix.go b/common/terminal_posix.go index c3c5752357d..6c69d79e9db 100644 --- a/common/terminal_posix.go +++ b/common/terminal_posix.go @@ -4,8 +4,8 @@ package common // Imports for determining terminal information across platforms import ( - "os" "golang.org/x/sys/unix" + "os" ) // posix api diff --git a/common/terminal_windows.go b/common/terminal_windows.go index 5ff0b48e3d7..2d394a3d777 100644 --- a/common/terminal_windows.go +++ b/common/terminal_windows.go @@ -80,4 +80,3 @@ func platformGetTerminalDimensions() (width, height int, err error) { return int(csbi.dwSize.X), int(csbi.dwSize.Y), nil } - diff --git a/packer/rpc/ui_test.go b/packer/rpc/ui_test.go index 373b1018561..4dd2d70368e 100644 --- a/packer/rpc/ui_test.go +++ b/packer/rpc/ui_test.go @@ -6,17 +6,17 @@ import ( ) type testUi struct { - askCalled bool - askQuery string - errorCalled bool - errorMessage string - machineCalled bool - machineType string - machineArgs []string - messageCalled bool - messageMessage string - sayCalled bool - sayMessage string + askCalled bool + askQuery string + errorCalled bool + errorMessage string + machineCalled bool + machineType string + machineArgs []string + messageCalled bool + messageMessage string + sayCalled bool + sayMessage string } func (u *testUi) Ask(query string) (string, error) {