Commit graph

5 commits

Author SHA1 Message Date
Yong Tang
102cfbd7fe Use gometalinter and enforcing go fmt/lint/vet ()
* Use gometalinter and enforcing go fmt/lint/vet

Before this PR go fmt is enabled, go lint is suggest only.
From time to time we have to manually check for go lint and go vet
for any issues.

This fix uses gometalinter and enforcing go fmt/lint/vet.
Several reasons:
- gometalinter could handle multiple linters concurrently
- gometalinter supports suppression with `// nolint[: <linter>]`

Previously one reason we didn't enable go lint was due to the
```
warning: context.Context should be the first parameter of a function (golint)
```
this is now possible with gometalinter and `// nolint: golint` (See changes).

This fix also discovered several go vet issues and fixes it.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix several issues reported by gometalinter (go vet)

This commit fixes several issues reported by gometalinter (go vet).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Increase deadline

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-24 11:59:04 +01:00
Miek Gieben
9c56805d38 mw/etcd: use context.TODO() in tests ()
Go vet warning: fix use of context.

Fixes 

Also make *auto*'s reload test less flaky by retrying
and then giving up.
2017-08-27 07:39:44 +01:00
Miek Gieben
f901b0cefa tests: CoreDNSServerAndPorts ()
* tests: CoreDNSServerAndPorts

Copy from kubernetes.go and renamed to fit the style, adapted almost
all callers.

This is a mechanicl change, no testdata was changed.

* typos
2017-08-24 11:35:14 +01:00
Miek Gieben
e49ca86ce4 cleanup: go vet and golint run ()
* cleanup: go vet and golint run

Various cleanups trickered by go vet and golint.

* Fix tests and lowercase all errors

Lowercase all errors, some tests in kubernetes use errors from
kubernetes which do start with a capital letter.
2017-06-14 09:37:10 -07:00
Miek Gieben
3b6eab2256 core: add reload tests ()
This adds a simple reload test for the UDP socket.
2017-04-18 11:25:21 +01:00