mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
apimachinery: cleanup if...else statement
if block ends with a return statement, so drop this else and outdent its block
This commit is contained in:
parent
3cd867fa6b
commit
10698f8774
@ -85,11 +85,10 @@ func ParseGroupKind(gk string) GroupKind {
|
|||||||
// ParseGroupResource turns "resource.group" string into a GroupResource struct. Empty strings are allowed
|
// ParseGroupResource turns "resource.group" string into a GroupResource struct. Empty strings are allowed
|
||||||
// for each field.
|
// for each field.
|
||||||
func ParseGroupResource(gr string) GroupResource {
|
func ParseGroupResource(gr string) GroupResource {
|
||||||
if i := strings.Index(gr, "."); i == -1 {
|
if i := strings.Index(gr, "."); i >= 0 {
|
||||||
return GroupResource{Resource: gr}
|
|
||||||
} else {
|
|
||||||
return GroupResource{Group: gr[i+1:], Resource: gr[:i]}
|
return GroupResource{Group: gr[i+1:], Resource: gr[:i]}
|
||||||
}
|
}
|
||||||
|
return GroupResource{Resource: gr}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion
|
// GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion
|
||||||
|
Loading…
Reference in New Issue
Block a user