ci: fix exhaustive linting (#8238)

pull/8249/head
Zen Dodd 2026-10-17 19:49:32 +10:00 committed by GitHub
parent 2e0f806104
commit 1619352f4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 2 deletions

View File

@ -62,8 +62,6 @@ linters:
- fmt.*
- (go.uber.org/zap/zapcore.ObjectEncoder).AddObject
- (go.uber.org/zap/zapcore.ObjectEncoder).AddArray
exhaustive:
ignore-enum-types: reflect.Kind|svc.Cmd
exclusions:
generated: lax
presets:

View File

@ -207,6 +207,8 @@ func (ctx Context) LoadModule(structPointer any, fieldName string) (any, error)
var result any
// Unsupported field kinds return an error.
//exhaustive:ignore
switch val.Kind() {
case reflect.Slice:
if isJSONRawMessage(typ) {

View File

@ -98,6 +98,8 @@ func UnwrapResponseWriterAs[T any](w http.ResponseWriter) (T, bool) {
func responseWriterPointer(w http.ResponseWriter) uintptr {
v := reflect.ValueOf(w)
// Only pointer-like kinds have stable identity.
//exhaustive:ignore
switch v.Kind() {
case reflect.Pointer, reflect.Map, reflect.Chan, reflect.Func, reflect.Slice, reflect.UnsafePointer:
if v.IsNil() {

View File

@ -49,6 +49,8 @@ func (runner) Execute(args []string, request <-chan svc.ChangeRequest, status ch
for {
req := <-request
// Unsupported service controls are ignored.
//exhaustive:ignore
switch req.Cmd {
case svc.Interrogate:
status <- req.CurrentStatus