[lxc-devel] [lxd/master] lxd-benchmark: Fix new go vet warnings

stgraber on Github lxc-bot at linuxcontainers.org
Tue Feb 13 23:00:43 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180213/245deb92/attachment.bin>
-------------- next part --------------
From 91b70ff5f43adc588ed292b028eba45cab50b1cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 13 Feb 2018 18:00:20 -0500
Subject: [PATCH] lxd-benchmark: Fix new go vet warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd-benchmark/benchmark/benchmark.go | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/lxd-benchmark/benchmark/benchmark.go b/lxd-benchmark/benchmark/benchmark.go
index 9e8abf9e2..2d96f6fdb 100644
--- a/lxd-benchmark/benchmark/benchmark.go
+++ b/lxd-benchmark/benchmark/benchmark.go
@@ -51,7 +51,7 @@ func LaunchContainers(c lxd.ContainerServer, count int, parallel int, image stri
 		return duration, err
 	}
 
-	startContainer := func(index int, wg *sync.WaitGroup) {
+	batchStart := func(index int, wg *sync.WaitGroup) {
 		defer wg.Done()
 
 		name := getContainerName(count, index)
@@ -79,7 +79,7 @@ func LaunchContainers(c lxd.ContainerServer, count int, parallel int, image stri
 		}
 	}
 
-	duration = processBatch(count, batchSize, startContainer)
+	duration = processBatch(count, batchSize, batchStart)
 	return duration, nil
 }
 
@@ -92,7 +92,7 @@ func CreateContainers(c lxd.ContainerServer, count int, parallel int, fingerprin
 		return duration, err
 	}
 
-	createContainer := func(index int, wg *sync.WaitGroup) {
+	batchCreate := func(index int, wg *sync.WaitGroup) {
 		defer wg.Done()
 
 		name := getContainerName(count, index)
@@ -104,7 +104,7 @@ func CreateContainers(c lxd.ContainerServer, count int, parallel int, fingerprin
 		}
 	}
 
-	duration = processBatch(count, batchSize, createContainer)
+	duration = processBatch(count, batchSize, batchCreate)
 
 	return duration, nil
 }
@@ -139,7 +139,7 @@ func StartContainers(c lxd.ContainerServer, containers []api.Container, parallel
 	count := len(containers)
 	logf("Starting %d containers", count)
 
-	startContainer := func(index int, wg *sync.WaitGroup) {
+	batchStart := func(index int, wg *sync.WaitGroup) {
 		defer wg.Done()
 
 		container := containers[index]
@@ -152,7 +152,7 @@ func StartContainers(c lxd.ContainerServer, containers []api.Container, parallel
 		}
 	}
 
-	duration = processBatch(count, batchSize, startContainer)
+	duration = processBatch(count, batchSize, batchStart)
 	return duration, nil
 }
 
@@ -168,7 +168,7 @@ func StopContainers(c lxd.ContainerServer, containers []api.Container, parallel
 	count := len(containers)
 	logf("Stopping %d containers", count)
 
-	stopContainer := func(index int, wg *sync.WaitGroup) {
+	batchStop := func(index int, wg *sync.WaitGroup) {
 		defer wg.Done()
 
 		container := containers[index]
@@ -181,7 +181,7 @@ func StopContainers(c lxd.ContainerServer, containers []api.Container, parallel
 		}
 	}
 
-	duration = processBatch(count, batchSize, stopContainer)
+	duration = processBatch(count, batchSize, batchStop)
 	return duration, nil
 }
 
@@ -197,7 +197,7 @@ func DeleteContainers(c lxd.ContainerServer, containers []api.Container, paralle
 	count := len(containers)
 	logf("Deleting %d containers", count)
 
-	deleteContainer := func(index int, wg *sync.WaitGroup) {
+	batchDelete := func(index int, wg *sync.WaitGroup) {
 		defer wg.Done()
 
 		container := containers[index]
@@ -217,7 +217,7 @@ func DeleteContainers(c lxd.ContainerServer, containers []api.Container, paralle
 		}
 	}
 
-	duration = processBatch(count, batchSize, deleteContainer)
+	duration = processBatch(count, batchSize, batchDelete)
 	return duration, nil
 }
 


More information about the lxc-devel mailing list