update vendor

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-11 07:10:14 +00:00
parent a18f72b565
commit ea8f47c73a
2901 changed files with 269317 additions and 43103 deletions

View File

@@ -24,7 +24,16 @@ func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) {
switch t.Kind {
case types.Struct:
for _, m := range t.Members {
if m.Type.Kind == types.Slice && types.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] == nil {
hasListType := types.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] != nil
if m.Name == "Items" && m.Type.Kind == types.Slice && hasNamedMember(t, "ListMeta") {
if hasListType {
fields = append(fields, m.Name)
}
continue
}
if m.Type.Kind == types.Slice && !hasListType {
fields = append(fields, m.Name)
continue
}
@@ -32,5 +41,13 @@ func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) {
}
return fields, nil
}
func hasNamedMember(t *types.Type, name string) bool {
for _, m := range t.Members {
if m.Name == name {
return true
}
}
return false
}

View File

@@ -155,7 +155,7 @@ func namesMatch(goName, jsonName string) bool {
return true
}
// isCaptical returns true if one character is capital
// isCapital returns true if one character is capital
func isCapital(b byte) bool {
return b >= 'A' && b <= 'Z'
}