Skip to content

Commit

Permalink
gofmt -w on all this stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
arizvisa committed Aug 19, 2018
1 parent eea5b91 commit 2bea3ed
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 22 deletions.
6 changes: 3 additions & 3 deletions common/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions common/progress_test.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/terminal_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package common

// Imports for determining terminal information across platforms
import (
"os"
"golang.org/x/sys/unix"
"os"
)

// posix api
Expand Down
1 change: 0 additions & 1 deletion common/terminal_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ func platformGetTerminalDimensions() (width, height int, err error) {

return int(csbi.dwSize.X), int(csbi.dwSize.Y), nil
}

22 changes: 11 additions & 11 deletions packer/rpc/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2bea3ed

Please sign in to comment.