let singularization handle non-conflicting ambiguity

This commit is contained in:
deads2k
2016-02-02 15:25:31 -05:00
parent 817d0f250a
commit 2d0fe7dbf1
2 changed files with 24 additions and 5 deletions

View File

@@ -56,6 +56,10 @@ type GroupVersionResource struct {
Resource string
}
func (gvr GroupVersionResource) IsEmpty() bool {
return len(gvr.Group) == 0 && len(gvr.Version) == 0 && len(gvr.Resource) == 0
}
func (gvr GroupVersionResource) GroupResource() GroupResource {
return GroupResource{Group: gvr.Group, Resource: gvr.Resource}
}