Skip to content

Commit 2521b0b

Browse files
committed
Update to golangci-lint 2.12.2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
1 parent ee4923c commit 2521b0b

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
- name: Run golangci-lint
4545
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
4646
with:
47-
version: v2.6.2
47+
version: v2.12.2

.golangci.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ linters:
4949
goconst:
5050
min-len: 2
5151
min-occurrences: 5
52+
ignore-tests: true
5253
gocritic:
5354
disabled-checks:
5455
- deprecatedComment
@@ -107,6 +108,12 @@ linters:
107108
text: '`(C|c)ancell.*` is a misspelling'
108109
- path: (.+)\.go$
109110
text: Error return value of `original.UnmarshalJSON` is not checked
111+
# Schema and OEM files list Redfish property names as string literals in
112+
# their writable-property allow-lists; these are spec data, not magic
113+
# constants worth extracting.
114+
- linters:
115+
- goconst
116+
path: (schemas|oem)/
110117
paths:
111118
- examples
112119
- tools

schemas/entity.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (e *Entity) UpdateFromRawData(resource any, rawData []byte, allowedUpdates
230230
return fmt.Errorf("resource type is nil")
231231
}
232232

233-
if resourceType.Kind() == reflect.Ptr {
233+
if resourceType.Kind() == reflect.Pointer {
234234
resourceType = resourceType.Elem()
235235
}
236236

@@ -258,10 +258,10 @@ func (e *Entity) UpdateFromRawData(resource any, rawData []byte, allowedUpdates
258258
return fmt.Errorf("invalid current value")
259259
}
260260

261-
if originalValue.Kind() == reflect.Ptr {
261+
if originalValue.Kind() == reflect.Pointer {
262262
originalValue = originalValue.Elem()
263263
}
264-
if currentValue.Kind() == reflect.Ptr {
264+
if currentValue.Kind() == reflect.Pointer {
265265
currentValue = currentValue.Elem()
266266
}
267267

@@ -310,10 +310,10 @@ func derefPointers(original, updated reflect.Value) (derefOriginal, derefUpdated
310310
derefOriginal = original
311311
derefUpdated = updated
312312

313-
if original.Kind() == reflect.Ptr {
313+
if original.Kind() == reflect.Pointer {
314314
derefOriginal = original.Elem()
315315
}
316-
if updated.Kind() == reflect.Ptr {
316+
if updated.Kind() == reflect.Pointer {
317317
derefUpdated = updated.Elem()
318318
}
319319
return
@@ -404,7 +404,7 @@ func compareField(payload map[string]any, fieldName string, original, updated re
404404
switch original.Kind() {
405405
case reflect.Struct:
406406
handleStructField(payload, fieldName, original, updated)
407-
case reflect.Ptr:
407+
case reflect.Pointer:
408408
handlePointerField(payload, fieldName, original, updated)
409409
case reflect.Slice, reflect.Map:
410410
handleCompositeField(payload, fieldName, original, updated)

0 commit comments

Comments
 (0)