chavacava
chavacava
Hi, I use the `gogo/protobuf` source code to test new linting rules for [`revive`](https://revive.run/). While testing a rule that detects identical `then` and `else` branches I've found the following issues...
The following `if` statement has identical blocks for the `then` and the `else` branches. https://github.com/zyedidia/micro/blob/9ce469f37289ee7acdde18a2e47dc7dcf899fa45/internal/views/splits.go#L325-L329 Found with [`revive`](https://github.com/mgechev/revive)'s rule `identical-branches`
Rules are tested through a tiny mechanism where rules are executed on source files with annotations describing the expected failures. For example: ```go package fixtures func foo(a, b, c, d...
The current implementation of `Stream.Size()` is: ```go // Size returns the number of bytes of the stream. func (k *Stream) Size() (int64, error) { // Go has no internal ReadSeeker...
https://github.com/aquasecurity/kube-bench/blob/dd39b19ffcd26d27b790916e844e3abf87b4a970/cmd/kubernetes_version_test.go#L267-L275 Could be simplified to just ```go if k8sURL != c.expected { t.Errorf("Expected %q but Got %q", k8sURL, c.expected) } ``` ? Found with [revive](https://github.com/mgechev/revive)
In the following code, both control branches do the same. https://github.com/btcsuite/btcd/blob/38ee9a41c8f8aa24a079a28f5e8a86faecffdfe1/cmd/btcctl/config.go#L143-L147 Found by [revive](https://github.com/mgechev/revive) (rule [`identical-branches`](https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#identical-branches))
https://github.com/chaos-mesh/chaos-mesh/blob/87b6322f9b46548053e03731c520652a5d7e2f4b/pkg/config/controller.go#L96 The empty string can not be the default value for an `int` field. In this particular case, the correct default value seems to be `53` (the default DNS port...
In the following conditional, the Boolean expressions at both sides of the && operator are identical https://github.com/ovh/cds/blob/77a1606908ee7113a5d23a1f1c0e89211904f6a9/engine/api/workflow/dao.go#L1088-L1090 It seems to be a typo in the slice index: one should be...
Hi @JasonSteving99, awesome work! I'm reading the reference guide carefully and I find Claro a nice and pleasant language. I love the pipe operator (that I first met with Elm)...
In the following conditional, the sub-expression `namespace == namespace` always evaluates to true. https://github.com/cert-manager/cert-manager/blob/7c7e8f4ce6c1abba18025d3d00be368066801a63/internal/vault/vault_test.go#L967 Should the conditional just be `name == secret` ? (Found while testing [revive](https://github.com/mgechev/revive) on cert-manager code...