mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
[fix] ignore unexported field (#2354)
ignore unexported field when register endpoints
This commit is contained in:
parent
4f1a571704
commit
90b3e4af0b
@ -29,6 +29,9 @@ func extractValue(v reflect.Type, d int) *registry.Value {
|
||||
case reflect.Struct:
|
||||
for i := 0; i < v.NumField(); i++ {
|
||||
f := v.Field(i)
|
||||
if !f.IsExported() {
|
||||
continue
|
||||
}
|
||||
val := extractValue(f.Type, d+1)
|
||||
if val == nil {
|
||||
continue
|
||||
|
@ -74,6 +74,9 @@ func extractValue(v reflect.Type, d int) *registry.Value {
|
||||
case reflect.Struct:
|
||||
for i := 0; i < v.NumField(); i++ {
|
||||
f := v.Field(i)
|
||||
if !f.IsExported() {
|
||||
continue
|
||||
}
|
||||
val := extractValue(f.Type, d+1)
|
||||
if val == nil {
|
||||
continue
|
||||
|
@ -29,6 +29,9 @@ func extractValue(v reflect.Type, d int) *registry.Value {
|
||||
case reflect.Struct:
|
||||
for i := 0; i < v.NumField(); i++ {
|
||||
f := v.Field(i)
|
||||
if !f.IsExported() {
|
||||
continue
|
||||
}
|
||||
val := extractValue(f.Type, d+1)
|
||||
if val == nil {
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user