// PkgPath is the package path that qualifies a lower case (unexported) // field name. It is empty for upper case (exported) field names. // See https://golang.org/ref/spec#Uniqueness_of_identifiers
CanSet() covers more cases than unexported fields, I would just use PkgPath instead.
if !reflect.ValueOf(strct).Field(i).CanInterface() {
continue
}