fix thirdparty API, now the config file of thirdpartyresource also need to group/version instead of version

This commit is contained in:
Chao Xu
2015-09-29 14:36:47 -07:00
parent a448b5e154
commit f4ff0f7683
6 changed files with 36 additions and 21 deletions

View File

@@ -37,3 +37,12 @@ func GetGroup(groupVersion string) string {
}
return s[0]
}
// GetGroupVersion returns the "group/version". It returns "version" is if group
// is empty. It returns "group/" if version is empty.
func GetGroupVersion(group, version string) string {
if len(group) == 0 {
return version
}
return group + "/" + version
}