Skip to content

Commit 9343e51

Browse files
committed
style(tests): invoke golint correctly and clean up its warnings
1 parent c13d0d4 commit 9343e51

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

tests/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ setup-gotools:
3434

3535
test-style:
3636
go vet -x ./...
37-
-golint *.go dockercli etcdutils mock utils
37+
-golint; golint dockercli; golint etcdutils; golint mock; golint utils
3838

3939
nuke_from_orbit:
4040
-docker kill `docker ps -q`

tests/etcdutils/etcdutils.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func InitEtcd(setdir, setkeys []string, port string) *EtcdHandle {
3434
return controllerHandle
3535
}
3636

37+
// SetSingle sets a key and value into a test etcd instance.
3738
func SetSingle(t *testing.T, key string, value string, port string) {
3839
c := etcdClient(port)
3940
_, err := c.Set(key, value, 0)
@@ -52,7 +53,7 @@ func SetEtcd(t *testing.T, keys []string, values []string, c *etcd.Client) {
5253
}
5354
}
5455

55-
// Verify an etcd key exists
56+
// VerifyEtcdKey verifies that an etcd key exists.
5657
func VerifyEtcdKey(t *testing.T, key string, port string) {
5758
c := etcdClient(port)
5859
_, err := c.Get(key, true, true)
@@ -61,15 +62,15 @@ func VerifyEtcdKey(t *testing.T, key string, port string) {
6162
}
6263
}
6364

64-
// Verify the value of an etcd key
65-
func VerifyEtcdValue(t *testing.T, key string, expected_value string, port string) {
65+
// VerifyEtcdValue verifies the value of an etcd key.
66+
func VerifyEtcdValue(t *testing.T, key string, expectedValue string, port string) {
6667
c := etcdClient(port)
6768
result, err := c.Get(key, true, true)
6869
if err != nil {
6970
t.Fatal(err)
7071
}
71-
if result.Node.Value != expected_value {
72-
t.Errorf(key + ": expected '" + expected_value + "', got '" + result.Node.Value + "'.")
72+
if result.Node.Value != expectedValue {
73+
t.Errorf(key + ": expected '" + expectedValue + "', got '" + result.Node.Value + "'.")
7374
}
7475
}
7576

0 commit comments

Comments
 (0)