From e4541d8b44188344032ca87308951aec2640cdf1 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 3 Mar 2022 17:47:12 +0300 Subject: [PATCH] fixup for older go Signed-off-by: Vasiliy Tolstov --- util.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util.go b/util.go index cad08cb..0673d1f 100644 --- a/util.go +++ b/util.go @@ -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)