• Yong Tang's avatar
    Use gometalinter and enforcing go fmt/lint/vet (#1108) · 102cfbd7
    Yong Tang authored
    * 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: default avatarYong 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: default avatarYong Tang <yong.tang.github@outlook.com>
    
    * Increase deadline
    Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
    102cfbd7
etcd_cache_test.go 1.86 KB