MCPcopy Create free account
hub / github.com/devfile/api / ContainsPatchStrategy

Function ContainsPatchStrategy

generator/genutils/patch_strategy.go:35–47  ·  view source on GitHub ↗

ContainsPatchStrategy reads the field tags to check whether the given patch strategy is defined

(field *markers.FieldInfo, strategy string)

Source from the content-addressed store, hash-verified

33
34// ContainsPatchStrategy reads the field tags to check whether the given patch strategy is defined
35func ContainsPatchStrategy(field *markers.FieldInfo, strategy string) bool {
36 patchStrategy := field.Tag.Get(patchStrategyTagKey)
37 if patchStrategy == "" {
38 return false
39 }
40
41 for _, s := range strings.Split(patchStrategy, ",") {
42 if s == strategy {
43 return true
44 }
45 }
46 return false
47}
48
49// GetPatchMergeKey reads the field tags to retrieve the patch merge key. It returns nil if no such key is defined
50func GetPatchMergeKey(field *markers.FieldInfo) string {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected