fix: unable to get net.Interface cause panic (#21277)

This commit is contained in:
jiuker 2025-05-16 22:28:04 +08:00 committed by GitHub
parent 1d50cae43d
commit ef9b03fbf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,7 +75,10 @@ var matchingFuncNames = [...]string{
var (
quietFlag, jsonFlag, anonFlag bool
// Custom function to format error
errorFmtFunc func(string, error, bool) string
// can be registered by RegisterError
errorFmtFunc = func(introMsg string, err error, jsonFlag bool) string {
return fmt.Sprintf("msg: %s\n err:%s", introMsg, err)
}
)
// EnableQuiet - turns quiet option on.