type PreconditionFunc … // RequireKeyUnchanged returns a precondition function that fails if the provided key // is present in the patch (indicating that its value has changed). func RequireKeyUnchanged(key string) PreconditionFunc { … } // RequireMetadataKeyUnchanged creates a precondition function that fails // if the metadata.key is present in the patch (indicating its value // has changed). func RequireMetadataKeyUnchanged(key string) PreconditionFunc { … } func ToYAMLOrError(v interface{ … } func toYAML(v interface{ … } // HasConflicts returns true if the left and right JSON interface objects overlap with // different values in any key. All keys are required to be strings. Since patches of the // same Type have congruent keys, this is valid for multiple patch types. This method // supports JSON merge patch semantics. // // NOTE: Numbers with different types (e.g. int(0) vs int64(0)) will be detected as conflicts. // Make sure the unmarshaling of left and right are consistent (e.g. use the same library). func HasConflicts(left, right interface{ … }