Skip to content

govet inline lint failure #870

@Sypher845

Description

@Sypher845

Description

The latest golangci-lint image includes an updated govet analyzer with the inline check, which flags uses of reflect.Ptr that should be inlined as a constant.

This causes the lint pipeline to fail on main:

pkg/utils/error.go:37:19: inline: Constant reflect.Ptr should be inlined (govet)                      
        if val.Kind() == reflect.Ptr {                                                                
                         ^                                                                            
pkg/utils/reflect.go:136:22: inline: Constant reflect.Ptr should be inlined (govet)                   
                if field.Kind() == reflect.Ptr && field.IsNil() {                                     
                                   ^                                                                  
pkg/utils/reflect.go:157:21: inline: Constant reflect.Ptr should be inlined (govet)                   
                        if val.Kind() == reflect.Ptr && !val.IsNil() {                                
                                         ^          

Fix

Replace all reflect.Ptr with reflect.Pointer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions