Here we add file `.golangci.yaml`, to have a common configuration for
static analysis. If you use the following IDEs/editors, they will read
the file:
- `vim` with vim-go.
- VSCode.
The initial configuration file is based on Kubernetes' HEAD. We removed
a custom kubernetes-linter for custom kubernetes-logging. We also
changed to Golang version 1.17 (etcd's current target Golang version)
from 1.18.
Also, we added a new target to `Makefile`: `lint`. NOTE that auto-fixing
should be part of a later commit, once we are all happy with how the
configuration file is working for us.
As expected, this change fixes two issues found by this `.golangci.yaml`
in file `contrib/lock/client/client.go`:
- Dead code, removed.
- Innefective assignment, removed.
Finally, we are updating `CONTRIBUTING.md` to mention `golangci-lint`.
We will add a GitHub-action to run `golangci-lint` in a future change.
Local testing done:
- `make build`.
- `make test`.
Both are happy.
This is the initial step to fix
https://github.com/etcd-io/etcd/issues/14164.
Signed-off-by: Ramsés Morales <ramses@gmail.com>
Updating the locking example to avoid relying on GC to break the lease.
Updating the documentation to reflect the build process better, improve
error messages and logging to not confuse first time users.
Fixes#14224
Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>