浏览代码

directly use isvalidpart

Josh Yan 11 月之前
父节点
当前提交
c365f195a8
共有 1 个文件被更改,包括 1 次插入7 次删除
  1. 1 7
      types/model/name.go

+ 1 - 7
types/model/name.go

@@ -252,13 +252,7 @@ func (n Name) DisplayShortest() string {
 }
 
 func IsValidNamespace(namespace string) bool {
-	name := Name{
-		Host:      "h",
-		Model:     "m",
-		Namespace: namespace,
-		Tag:       "t",
-	}
-	return name.IsValid()
+	return isValidPart(kindNamespace, namespace)
 }
 
 // IsValid reports whether all parts of the name are present and valid. The