change patches to patchesStrategicMerge in tests and examples

This commit is contained in:
Jingfang Liu
2018-08-28 09:36:45 -07:00
parent e11ba17248
commit b713d5a1cc
20 changed files with 40 additions and 28 deletions

View File

@@ -22,9 +22,19 @@ package patch
type PatchStrategicMerge string
// Append appends a slice of patch paths to a PatchStategicMerge slice
func Append(patches []PatchStrategicMerge, paths []string) []PatchStrategicMerge {
func Append(patches []PatchStrategicMerge, paths ...string) []PatchStrategicMerge {
for _, p := range paths {
patches = append(patches, PatchStrategicMerge(p))
}
return patches
}
// Exist determines if a patch path exists in a slice of PatchStategicMerge
func Exist(patches []PatchStrategicMerge, path string) bool {
for _, p := range patches {
if p == PatchStrategicMerge(path) {
return true
}
}
return false
}