mirror of https://github.com/VinGarcia/ksql.git
Merge pull request #55 from mrheinen/master
Check if a field is private after confirming it has a ksql tagmaster
commit
24b9313323
|
@ -257,10 +257,6 @@ func getTagNames(t reflect.Type) (_ StructInfo, err error) {
|
||||||
byName: map[string]*FieldInfo{},
|
byName: map[string]*FieldInfo{},
|
||||||
}
|
}
|
||||||
for i := 0; i < t.NumField(); i++ {
|
for i := 0; i < t.NumField(); i++ {
|
||||||
// If this field is private:
|
|
||||||
if t.Field(i).PkgPath != "" {
|
|
||||||
return StructInfo{}, fmt.Errorf("all fields using the ksql tags must be exported, but %v is unexported", t)
|
|
||||||
}
|
|
||||||
|
|
||||||
attrName := t.Field(i).Name
|
attrName := t.Field(i).Name
|
||||||
name := t.Field(i).Tag.Get("ksql")
|
name := t.Field(i).Tag.Get("ksql")
|
||||||
|
@ -268,6 +264,11 @@ func getTagNames(t reflect.Type) (_ StructInfo, err error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this field is private:
|
||||||
|
if t.Field(i).PkgPath != "" {
|
||||||
|
return StructInfo{}, fmt.Errorf("all fields using the ksql tags must be exported, but %v is unexported", t)
|
||||||
|
}
|
||||||
|
|
||||||
tags := strings.Split(name, ",")
|
tags := strings.Split(name, ",")
|
||||||
var modifier ksqlmodifiers.AttrModifier
|
var modifier ksqlmodifiers.AttrModifier
|
||||||
if len(tags) > 1 {
|
if len(tags) > 1 {
|
||||||
|
|
Loading…
Reference in New Issue