mirror of
https://github.com/go-kratos/kratos.git
synced 2025-02-07 13:31:50 +02:00
binding: ignore unexpected field (#879)
This commit is contained in:
parent
f33bd70d75
commit
8b875e43a5
@ -4,7 +4,6 @@ import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -51,7 +50,7 @@ func populateFieldValues(v protoreflect.Message, fieldPath []string, values []st
|
||||
if fd = fields.ByName(protoreflect.Name(fieldName)); fd == nil {
|
||||
fd = fields.ByJSONName(fieldName)
|
||||
if fd == nil {
|
||||
log.Printf("field not found in %q: %q\n", v.Descriptor().FullName(), strings.Join(fieldPath, "."))
|
||||
// ignore unexpected field.
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user