From 0cfc53bf8fff9258b4049240ceebc69e49ac2ee1 Mon Sep 17 00:00:00 2001 From: Onsi Fakhouri Date: Thu, 27 Oct 2022 09:44:39 -0600 Subject: [PATCH] godoc for gcustom --- gcustom/make_matcher.go | 118 +++++++++++++++++++++++++++++++++++ gcustom/make_matcher_test.go | 57 +++++++++++++++++ 2 files changed, 175 insertions(+) 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,