Commit Graph

8 Commits (c13a1d47f5885302ae66e28a2d70212a6d39796b)

Author SHA1 Message Date
Sasha Melentyev 2c9c209eb6 all: Changing Printf and friends to Print if there is no formatting
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 22:11:23 +03:00
Sasha Melentyev 855aa4f7a7 all: Use ReplaceAll instead of Replace with -1 pos
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 00:06:09 +03:00
Ramsés Morales a7a48168a0 Add golangci-lint config file and `make` target.
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>
2022-07-28 17:55:08 -07:00
Thomas Jungblut 118ab24b39 update contrib/lock example
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>
2022-07-22 12:14:37 +02:00
Piotr Tabor fe35b5130e Fix code scanning alert: This log write receives unsanitized user input 2022-04-19 13:49:08 +02:00
Eng Zer Jun 2a151c8982
*: move from io/ioutil to io and os packages
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>
2021-10-28 00:05:28 +08:00
Piotr Tabor ffea1537d4 ClientV3 tests use integration.NewClient that configures proper logger. 2021-04-29 18:18:34 +02:00
Patrice Chalin 2ba69de281 Contrib lock example 2021-04-06 15:21:01 -04:00