Skip to content

Commit

Permalink
chore: enable unnecessary-stmt rule from revive
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Jan 15, 2025
1 parent 2dbb689 commit 8202497
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion client/pkg/types/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func NewURLs(strs []string) (URLs, error) {
return nil, fmt.Errorf("URL must not contain a path: %s", in)
}
case "unix", "unixs":
break
default:
return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in)
}
Expand Down
3 changes: 1 addition & 2 deletions server/etcdmain/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ func startEtcdOrProxyV2(args []string) {
lg.Info("Running: ", zap.Strings("args", args))
if err != nil {
lg.Warn("failed to verify flags", zap.Error(err))
switch {
case errorspkg.Is(err, embed.ErrUnsetAdvertiseClientURLsFlag):
if errorspkg.Is(err, embed.ErrUnsetAdvertiseClientURLsFlag) {

Check warning on line 67 in server/etcdmain/etcd.go

View check run for this annotation

Codecov / codecov/patch

server/etcdmain/etcd.go#L67

Added line #L67 was not covered by tests
lg.Warn("advertise client URLs are not set", zap.Error(err))
}
os.Exit(1)
Expand Down
3 changes: 1 addition & 2 deletions server/storage/wal/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ func Repair(lg *zap.Logger, dirpath string) bool {
switch {
case err == nil:
// update crc of the decoder when necessary
switch rec.Type {
case CrcType:
if rec.Type == CrcType {
crc := decoder.LastCRC()
// current crc of decoder must match the crc of the record.
// do no need to match 0 crc, since the decoder is a new one at this case.
Expand Down
2 changes: 2 additions & 0 deletions tools/.golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ linters-settings: # please keep this alphabetized
disabled: false
- name: time-naming
disabled: false
- name: unnecessary-stmt
disabled: false
- name: use-any
disabled: false
- name: var-declaration
Expand Down

0 comments on commit 8202497

Please sign in to comment.