Remove unused variables (only assigned to) from test code.

This is revealed by the go/types package, which is stricter than
the Go compiler about unused variables. See also: golang/go#8560
This commit is contained in:
Ryan Hitchman
2018-02-02 13:34:57 -08:00
parent b79fe10730
commit e04b91facf
13 changed files with 10 additions and 38 deletions

View File

@@ -308,7 +308,6 @@ func TestGetNodeConditionPredicate(t *testing.T) {
func TestProcessServiceUpdate(t *testing.T) {
var controller *ServiceController
var cloud *fakecloud.FakeCloud
//A pair of old and new loadbalancer IP address
oldLBIP := "192.168.1.1"
@@ -327,7 +326,7 @@ func TestProcessServiceUpdate(t *testing.T) {
svc: defaultExternalService(),
updateFn: func(svc *v1.Service) *v1.Service {
controller, cloud, _ = newController()
controller, _, _ = newController()
controller.cache.getOrCreate("validKey")
return svc
@@ -398,7 +397,6 @@ func TestProcessServiceUpdate(t *testing.T) {
func TestSyncService(t *testing.T) {
var controller *ServiceController
var cloud *fakecloud.FakeCloud
testCases := []struct {
testName string
@@ -410,7 +408,7 @@ func TestSyncService(t *testing.T) {
testName: "if an invalid service name is synced",
key: "invalid/key/string",
updateFn: func() {
controller, cloud, _ = newController()
controller, _, _ = newController()
},
expectedFn: func(e error) error {
@@ -429,7 +427,7 @@ func TestSyncService(t *testing.T) {
testName: "if an invalid service is synced",
key: "somethingelse",
updateFn: func() {
controller, cloud, _ = newController()
controller, _, _ = newController()
srv := controller.cache.getOrCreate("external-balancer")
srv.state = defaultExternalService()
},
@@ -443,7 +441,7 @@ func TestSyncService(t *testing.T) {
key: "external-balancer",
updateFn: func() {
testSvc := defaultExternalService()
controller, cloud, _ = newController()
controller, _, _ = newController()
controller.enqueueService(testSvc)
svc := controller.cache.getOrCreate("external-balancer")
svc.state = testSvc