diff --git a/gcustom/make_matcher.go b/gcustom/make_matcher.go index 8395da4fd..f3cd51ff9 100644 --- a/gcustom/make_matcher.go +++ b/gcustom/make_matcher.go @@ -1,3 +1,6 @@ +/* +package gcustom provides a simple mechanism for creating custom Gomega matchers +*/ package gcustom import ( @@ -22,12 +25,65 @@ func formatObject(object any, indent ...uint) string { return format.Object(object, indentation) } +/* +ParseTemplate allows you to precompile templates for MakeMatcher's custom matchers. + +Use ParseTemplate if you are concerned about performance and would like to avoid repeatedly parsing failure message templates. The data made available to the template is documented in the WithTemplate() method of CustomGomegaMatcher. + +Once parsed you can pass the template in either as an argument to MakeMatcher(matchFunc,