Merge pull request #44913 from zhangxiaoyu-zidif/cleancode-util-for-err

Automatic merge from submit-queue

cleancode:util.go

cleancode, the modification point make code clean and light
This commit is contained in:
Kubernetes Submit Queue 2017-05-02 17:03:26 -07:00 committed by GitHub
commit fc51574bb4

View File

@ -254,9 +254,9 @@ func GetVersionedClientForRBACOrFail(hostFactory cmdutil.Factory) (client.Interf
}
return hostFactory.ClientSetForVersion(&gv)
}
for i := 0; i < len(g.Versions); i++ {
if g.Versions[i].GroupVersion != "" {
gv, err := schema.ParseGroupVersion(g.Versions[i].GroupVersion)
for _, version := range g.Versions {
if version.GroupVersion != "" {
gv, err := schema.ParseGroupVersion(version.GroupVersion)
if err != nil {
return nil, err
}