Merge pull request #56 from unistack-org/fix_exported

fixup for older go
This commit is contained in:
Василий Толстов 2022-03-03 17:47:30 +03:00 committed by GitHub
commit 241114aeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,10 +92,15 @@ func newPathRequest(path string, method string, body string, msg interface{}, ta
continue continue
} }
fld := tmsg.Type().Field(i) fld := tmsg.Type().Field(i)
// Skip unexported fields.
if fld.PkgPath != "" {
continue
}
/* check for empty PkgPath can be replaced with new method IsExported
if !fld.IsExported() { if !fld.IsExported() {
continue continue
} }
*/
t := &tag{} t := &tag{}
for _, tn := range tags { for _, tn := range tags {
ts, ok := fld.Tag.Lookup(tn) ts, ok := fld.Tag.Lookup(tn)