From 38f5f39e488e174d49bfe3b27a0bf3331d74a163 Mon Sep 17 00:00:00 2001 From: Michael Whatcott Date: Thu, 30 Jan 2014 20:53:54 -0700 Subject: [PATCH] Normalized imports in the web/server packages. --- web/server/api/server.go | 3 ++- web/server/api/server_test.go | 5 +++-- web/server/contract/monitor.go | 4 +--- web/server/contract/monitor_test.go | 3 ++- web/server/contract/result.go | 3 ++- web/server/executor/contract.go | 4 +--- web/server/executor/coordinator.go | 3 ++- web/server/executor/executor.go | 3 ++- web/server/executor/executor_test.go | 5 +++-- web/server/executor/tester.go | 3 ++- web/server/executor/tester_test.go | 5 +++-- web/server/parser/packageParser.go | 3 ++- web/server/parser/package_parser_go1.1_test.go | 5 +++-- web/server/parser/package_parser_go1.2_test.go | 5 +++-- web/server/parser/parser.go | 3 ++- web/server/parser/parser_test.go | 3 ++- web/server/parser/rules_go1.1.go | 4 +--- web/server/parser/rules_go1.2.go | 4 +--- web/server/parser/testParser.go | 5 +++-- web/server/system/fake_file_system_test.go | 3 ++- web/server/system/fake_shell_test.go | 3 ++- web/server/watcher/gopath.go | 5 +++-- web/server/watcher/gopath_test.go | 3 ++- web/server/watcher/scanner.go | 3 ++- web/server/watcher/scanner_test.go | 5 +++-- web/server/watcher/walk_step.go | 3 ++- web/server/watcher/watcher.go | 3 ++- 27 files changed, 58 insertions(+), 43 deletions(-) diff --git a/web/server/api/server.go b/web/server/api/server.go index 3bab7eae..a02ca007 100644 --- a/web/server/api/server.go +++ b/web/server/api/server.go @@ -3,9 +3,10 @@ package api import ( "encoding/json" "fmt" - "github.com/smartystreets/goconvey/web/server/contract" "net/http" "time" + + "github.com/smartystreets/goconvey/web/server/contract" ) type HTTPServer struct { diff --git a/web/server/api/server_test.go b/web/server/api/server_test.go index 1314a902..2d7eebb8 100644 --- a/web/server/api/server_test.go +++ b/web/server/api/server_test.go @@ -4,14 +4,15 @@ import ( "encoding/json" "errors" "fmt" - . "github.com/smartystreets/goconvey/convey" - "github.com/smartystreets/goconvey/web/server/contract" "net/http" "net/http/httptest" "net/url" "strings" "testing" "time" + + . "github.com/smartystreets/goconvey/convey" + "github.com/smartystreets/goconvey/web/server/contract" ) const initialRoot = "/root/gopath/src/github.com/smartystreets/project" diff --git a/web/server/contract/monitor.go b/web/server/contract/monitor.go index 57f0d743..eae24c8c 100644 --- a/web/server/contract/monitor.go +++ b/web/server/contract/monitor.go @@ -1,8 +1,6 @@ package contract -import ( - "log" -) +import "log" type Monitor struct { scanner Scanner diff --git a/web/server/contract/monitor_test.go b/web/server/contract/monitor_test.go index 4247b041..1e0b291d 100644 --- a/web/server/contract/monitor_test.go +++ b/web/server/contract/monitor_test.go @@ -1,9 +1,10 @@ package contract import ( - . "github.com/smartystreets/goconvey/convey" "net/http" "testing" + + . "github.com/smartystreets/goconvey/convey" ) func TestMonitor(t *testing.T) { diff --git a/web/server/contract/result.go b/web/server/contract/result.go index b0c1bba1..35e45026 100644 --- a/web/server/contract/result.go +++ b/web/server/contract/result.go @@ -1,9 +1,10 @@ package contract import ( - "github.com/smartystreets/goconvey/reporting" "path/filepath" "strings" + + "github.com/smartystreets/goconvey/reporting" ) type Package struct { diff --git a/web/server/executor/contract.go b/web/server/executor/contract.go index fb2b34c6..209dbca5 100644 --- a/web/server/executor/contract.go +++ b/web/server/executor/contract.go @@ -1,8 +1,6 @@ package executor -import ( - "github.com/smartystreets/goconvey/web/server/contract" -) +import "github.com/smartystreets/goconvey/web/server/contract" type Parser interface { Parse([]*contract.Package) diff --git a/web/server/executor/coordinator.go b/web/server/executor/coordinator.go index e1e131d3..92a68fd4 100644 --- a/web/server/executor/coordinator.go +++ b/web/server/executor/coordinator.go @@ -2,9 +2,10 @@ package executor import ( "fmt" - "github.com/smartystreets/goconvey/web/server/contract" "log" "sync" + + "github.com/smartystreets/goconvey/web/server/contract" ) type concurrentCoordinator struct { diff --git a/web/server/executor/executor.go b/web/server/executor/executor.go index ba2251ca..08e3b081 100644 --- a/web/server/executor/executor.go +++ b/web/server/executor/executor.go @@ -1,9 +1,10 @@ package executor import ( - "github.com/smartystreets/goconvey/web/server/contract" "log" "time" + + "github.com/smartystreets/goconvey/web/server/contract" ) const ( diff --git a/web/server/executor/executor_test.go b/web/server/executor/executor_test.go index 29e1ac16..fabcd17b 100644 --- a/web/server/executor/executor_test.go +++ b/web/server/executor/executor_test.go @@ -1,11 +1,12 @@ package executor import ( - . "github.com/smartystreets/goconvey/convey" - "github.com/smartystreets/goconvey/web/server/contract" "strings" "testing" "time" + + . "github.com/smartystreets/goconvey/convey" + "github.com/smartystreets/goconvey/web/server/contract" ) func TestExecutor(t *testing.T) { diff --git a/web/server/executor/tester.go b/web/server/executor/tester.go index 2a1a47be..e142a1e8 100644 --- a/web/server/executor/tester.go +++ b/web/server/executor/tester.go @@ -1,8 +1,9 @@ package executor import ( - "github.com/smartystreets/goconvey/web/server/contract" "log" + + "github.com/smartystreets/goconvey/web/server/contract" ) type ConcurrentTester struct { diff --git a/web/server/executor/tester_test.go b/web/server/executor/tester_test.go index 02fcf5d4..2e15816f 100644 --- a/web/server/executor/tester_test.go +++ b/web/server/executor/tester_test.go @@ -3,10 +3,11 @@ package executor import ( "errors" "fmt" - . "github.com/smartystreets/goconvey/convey" - "github.com/smartystreets/goconvey/web/server/contract" "testing" "time" + + . "github.com/smartystreets/goconvey/convey" + "github.com/smartystreets/goconvey/web/server/contract" ) func TestConcurrentTester(t *testing.T) { diff --git a/web/server/parser/packageParser.go b/web/server/parser/packageParser.go index e81dc272..150caf79 100644 --- a/web/server/parser/packageParser.go +++ b/web/server/parser/packageParser.go @@ -2,9 +2,10 @@ package parser import ( "fmt" - "github.com/smartystreets/goconvey/web/server/contract" "strconv" "strings" + + "github.com/smartystreets/goconvey/web/server/contract" ) func ParsePackageResults(result *contract.PackageResult, rawOutput string) { diff --git a/web/server/parser/package_parser_go1.1_test.go b/web/server/parser/package_parser_go1.1_test.go index 10dd1f30..f74d4f32 100644 --- a/web/server/parser/package_parser_go1.1_test.go +++ b/web/server/parser/package_parser_go1.1_test.go @@ -5,10 +5,11 @@ package parser import ( "encoding/json" "fmt" - "github.com/smartystreets/goconvey/reporting" - "github.com/smartystreets/goconvey/web/server/contract" "strings" "testing" + + "github.com/smartystreets/goconvey/reporting" + "github.com/smartystreets/goconvey/web/server/contract" ) func TestParsePackage_NoGoFiles_ReturnsPackageResult(t *testing.T) { diff --git a/web/server/parser/package_parser_go1.2_test.go b/web/server/parser/package_parser_go1.2_test.go index 12b1518b..8bdbdafc 100644 --- a/web/server/parser/package_parser_go1.2_test.go +++ b/web/server/parser/package_parser_go1.2_test.go @@ -5,10 +5,11 @@ package parser import ( "encoding/json" "fmt" - "github.com/smartystreets/goconvey/reporting" - "github.com/smartystreets/goconvey/web/server/contract" "strings" "testing" + + "github.com/smartystreets/goconvey/reporting" + "github.com/smartystreets/goconvey/web/server/contract" ) func TestParsePackage_NoGoFiles_ReturnsPackageResult(t *testing.T) { diff --git a/web/server/parser/parser.go b/web/server/parser/parser.go index 4a1fcd36..c686401f 100644 --- a/web/server/parser/parser.go +++ b/web/server/parser/parser.go @@ -1,8 +1,9 @@ package parser import ( - "github.com/smartystreets/goconvey/web/server/contract" "log" + + "github.com/smartystreets/goconvey/web/server/contract" ) type Parser struct { diff --git a/web/server/parser/parser_test.go b/web/server/parser/parser_test.go index 891c4af9..52e5d085 100644 --- a/web/server/parser/parser_test.go +++ b/web/server/parser/parser_test.go @@ -1,9 +1,10 @@ package parser import ( + "testing" + . "github.com/smartystreets/goconvey/convey" "github.com/smartystreets/goconvey/web/server/contract" - "testing" ) func TestParser(t *testing.T) { diff --git a/web/server/parser/rules_go1.1.go b/web/server/parser/rules_go1.1.go index 949c42c1..ed3cdf83 100644 --- a/web/server/parser/rules_go1.1.go +++ b/web/server/parser/rules_go1.1.go @@ -2,9 +2,7 @@ package parser -import ( - "strings" -) +import "strings" func noGoFiles(line string) bool { return strings.HasPrefix(line, "can't load package: ") && diff --git a/web/server/parser/rules_go1.2.go b/web/server/parser/rules_go1.2.go index 114bbde5..78b5d36a 100644 --- a/web/server/parser/rules_go1.2.go +++ b/web/server/parser/rules_go1.2.go @@ -2,9 +2,7 @@ package parser -import ( - "strings" -) +import "strings" func noGoFiles(line string) bool { return strings.HasPrefix(line, "can't load package: ") && diff --git a/web/server/parser/testParser.go b/web/server/parser/testParser.go index 3b754231..b3ebad57 100644 --- a/web/server/parser/testParser.go +++ b/web/server/parser/testParser.go @@ -3,10 +3,11 @@ package parser import ( "encoding/json" "fmt" - "github.com/smartystreets/goconvey/reporting" - "github.com/smartystreets/goconvey/web/server/contract" "strconv" "strings" + + "github.com/smartystreets/goconvey/reporting" + "github.com/smartystreets/goconvey/web/server/contract" ) type testParser struct { diff --git a/web/server/system/fake_file_system_test.go b/web/server/system/fake_file_system_test.go index 2c633508..886b8250 100644 --- a/web/server/system/fake_file_system_test.go +++ b/web/server/system/fake_file_system_test.go @@ -1,10 +1,11 @@ package system import ( - . "github.com/smartystreets/goconvey/convey" "os" "testing" "time" + + . "github.com/smartystreets/goconvey/convey" ) func TestFakeFileSystem(t *testing.T) { diff --git a/web/server/system/fake_shell_test.go b/web/server/system/fake_shell_test.go index cb7af555..6a485cbc 100644 --- a/web/server/system/fake_shell_test.go +++ b/web/server/system/fake_shell_test.go @@ -1,8 +1,9 @@ package system import ( - . "github.com/smartystreets/goconvey/convey" "testing" + + . "github.com/smartystreets/goconvey/convey" ) func TestFakeShell(t *testing.T) { diff --git a/web/server/watcher/gopath.go b/web/server/watcher/gopath.go index 4dba575f..5ff8f3fa 100644 --- a/web/server/watcher/gopath.go +++ b/web/server/watcher/gopath.go @@ -2,13 +2,14 @@ package watcher import ( "fmt" - "github.com/smartystreets/goconvey/web/server/contract" "path/filepath" "strings" + + "github.com/smartystreets/goconvey/web/server/contract" ) type goPath struct { - shell contract.Shell + shell contract.Shell } func (self *goPath) ResolvePackageName(folder string) string { diff --git a/web/server/watcher/gopath_test.go b/web/server/watcher/gopath_test.go index 577e8e2e..875b1a2c 100644 --- a/web/server/watcher/gopath_test.go +++ b/web/server/watcher/gopath_test.go @@ -1,9 +1,10 @@ package watcher import ( + "testing" + . "github.com/smartystreets/goconvey/convey" "github.com/smartystreets/goconvey/web/server/system" - "testing" ) func TestGoPath(t *testing.T) { diff --git a/web/server/watcher/scanner.go b/web/server/watcher/scanner.go index b1bd0270..c14a8146 100644 --- a/web/server/watcher/scanner.go +++ b/web/server/watcher/scanner.go @@ -1,9 +1,10 @@ package watcher import ( - "github.com/smartystreets/goconvey/web/server/contract" "log" "os" + + "github.com/smartystreets/goconvey/web/server/contract" ) type Scanner struct { diff --git a/web/server/watcher/scanner_test.go b/web/server/watcher/scanner_test.go index 7240dce6..643ee2ce 100644 --- a/web/server/watcher/scanner_test.go +++ b/web/server/watcher/scanner_test.go @@ -1,11 +1,12 @@ package watcher import ( + "testing" + "time" + . "github.com/smartystreets/goconvey/convey" "github.com/smartystreets/goconvey/web/server/contract" "github.com/smartystreets/goconvey/web/server/system" - "testing" - "time" ) func TestScanner(t *testing.T) { diff --git a/web/server/watcher/walk_step.go b/web/server/watcher/walk_step.go index 3b4bd8d8..b57f6a65 100644 --- a/web/server/watcher/walk_step.go +++ b/web/server/watcher/walk_step.go @@ -1,10 +1,11 @@ package watcher import ( - "github.com/smartystreets/goconvey/web/server/contract" "os" "path/filepath" "strings" + + "github.com/smartystreets/goconvey/web/server/contract" ) type walkStep struct { diff --git a/web/server/watcher/watcher.go b/web/server/watcher/watcher.go index ebc5c107..84f8fdd9 100644 --- a/web/server/watcher/watcher.go +++ b/web/server/watcher/watcher.go @@ -3,11 +3,12 @@ package watcher import ( "errors" "fmt" - "github.com/smartystreets/goconvey/web/server/contract" "log" "os" "path/filepath" "strings" + + "github.com/smartystreets/goconvey/web/server/contract" ) type Watcher struct {