Skip to content

Commit

Permalink
remove a call to StructField.IsExported as it is not in go1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
huandu committed Jul 16, 2022
1 parent 3cc1671 commit 20e19b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion structfields.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 20e19b9

Please sign in to comment.