Skip to content

Commit 1c9eef9

Browse files
authored
[-] fix linter warning "impossible condition: nil != nil" (#652)
1 parent 48e2e21 commit 1c9eef9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ linters:
99
linters-settings:
1010
gocyclo:
1111
# minimal code complexity to report, 30 by default (but we recommend 10-20)
12-
min-complexity: 50
12+
min-complexity: 20
1313

1414
issues:
1515
# List of regexps of issue texts to exclude, empty list by default.
1616
# But independently of this option we use default exclude patterns,
1717
# it can be disabled by `exclude-use-default: false`. To list all
1818
# excluded by default patterns execute `golangci-lint run --help`
1919
exclude:
20-
- CPUTimesStat # SA1019: CPUTimesStat is deprecated
21-
- SA5008 # duplicate struct tag "choice" (staticcheck)
20+
- SA1019 # CPUTimesStat.Total is deprecated
21+
- SA5008 # duplicate struct tag "choice" (staticcheck)

internal/metrics/psutil/psutil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func GetGoPsutilDiskPG(DataDirs, TblspaceDirs []map[string]any) ([]map[string]an
181181
if err != nil {
182182
return nil, err
183183
}
184-
if err != nil || ldDevice != ddDevice { // no point to report same data in case of single folder configuration
184+
if ldDevice != ddDevice { // no point to report same data in case of single folder configuration
185185
ld := make(map[string]any)
186186
ldUsage, err := disk.Usage(logDirPath)
187187
if err != nil {
@@ -212,7 +212,7 @@ func GetGoPsutilDiskPG(DataDirs, TblspaceDirs []map[string]any) ([]map[string]an
212212
return nil, err
213213
}
214214

215-
if err != nil || walDevice != ddDevice || walDevice != ldDevice { // no point to report same data in case of single folder configuration
215+
if walDevice != ddDevice || walDevice != ldDevice { // no point to report same data in case of single folder configuration
216216
walUsage, err := disk.Usage(walDirPath)
217217
if err != nil {
218218
return nil, err

0 commit comments

Comments
 (0)