remove a call to StructField.IsExported as it is not in go1.13

This commit is contained in:
Huan Du
2022-07-16 14:40:00 +08:00
parent 0304f8a109
commit 3dc5cbacd2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -437,7 +437,7 @@ func (s *Struct) Values(st interface{}) []interface{} {
return s.ValuesForTag("", st)
}
// Values returns a shadow copy of all fields tagged with tag in st.
// ValuesForTag returns a shadow copy of all fields tagged with tag in st.
func (s *Struct) ValuesForTag(tag string, value interface{}) (values []interface{}) {
sf := s.structFieldsParser()
v := reflect.ValueOf(value)
+1 -1
View File
@@ -52,7 +52,7 @@ func (sf *structFields) parse(t reflect.Type, mapper FieldMapperFunc, prefix str
field := t.Field(i)
// Skip unexported fields that are not embedded structs.
if !field.IsExported() && !field.Anonymous {
if field.PkgPath != "" && !field.Anonymous {
continue
}