diff options
author | 2017-09-24 03:59:04 -0700 | |
---|---|---|
committer | 2017-09-24 11:59:04 +0100 | |
commit | 102cfbd7fec2a2f32d73167e44b3417f153a7602 (patch) | |
tree | e0057e6dcc1d645f31aa6d50f3779286eb63240e /plugin/plugin.go | |
parent | 387ceb480bf6303cdc3d2677c07e44204ea47419 (diff) | |
download | coredns-102cfbd7fec2a2f32d73167e44b3417f153a7602.tar.gz coredns-102cfbd7fec2a2f32d73167e44b3417f153a7602.tar.zst coredns-102cfbd7fec2a2f32d73167e44b3417f153a7602.zip |
Use gometalinter and enforcing go fmt/lint/vet (#1108)
* 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>
Diffstat (limited to 'plugin/plugin.go')
-rw-r--r-- | plugin/plugin.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/plugin.go b/plugin/plugin.go index 0c4d7f604..d6b7c9976 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -69,7 +69,7 @@ func Error(name string, err error) error { return fmt.Errorf("%s/%s: %s", "plugi // NextOrFailure calls next.ServeDNS when next is not nill, otherwise it will return, a ServerFailure // and a nil error. -func NextOrFailure(name string, next Handler, ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { +func NextOrFailure(name string, next Handler, ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { // nolint: golint if next != nil { if span := ot.SpanFromContext(ctx); span != nil { child := span.Tracer().StartSpan(next.Name(), ot.ChildOf(span.Context())) |