fixup for older go

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2022-03-03 17:47:12 +03:00
parent c21d30e4a0
commit e4541d8b44

View File

@ -92,10 +92,15 @@ func newPathRequest(path string, method string, body string, msg interface{}, ta
continue
}
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() {
continue
}
*/
t := &tag{}
for _, tn := range tags {
ts, ok := fld.Tag.Lookup(tn)