@@ -27,22 +27,22 @@ var (
2727// VerifyWithExtension(t, strings.NewReader("Hello"), ".json")
2828//
2929// Deprecated: Please use Verify with the Options() fluent syntax.
30- func VerifyWithExtension (t core.Failable , reader io.Reader , extWithDot string , opts ... verifyOptions ) {
30+ func VerifyWithExtension (t core.Failable , reader io.Reader , extWithDot string , opts ... VerifyOptions ) {
3131 t .Helper ()
3232 Verify (t , reader , alwaysOption (opts ).ForFile ().WithExtension (extWithDot ))
3333}
3434
3535// Verify Example:
3636//
3737// Verify(t, strings.NewReader("Hello"))
38- func Verify (t core.Failable , reader io.Reader , opts ... verifyOptions ) {
38+ func Verify (t core.Failable , reader io.Reader , opts ... VerifyOptions ) {
3939 t .Helper ()
4040
4141 if len (opts ) > 1 {
4242 panic ("Please use fluent syntax for options, see documentation for more information" )
4343 }
4444
45- var opt verifyOptions
45+ var opt VerifyOptions
4646 if len (opts ) > 0 {
4747 opt = opts [0 ]
4848 }
@@ -71,7 +71,7 @@ func Verify(t core.Failable, reader io.Reader, opts ...verifyOptions) {
7171
7272// VerifyString stores the passed string into the received file and confirms
7373// that it matches the approved local file. On failure, it will launch a reporter.
74- func VerifyString (t core.Failable , s string , opts ... verifyOptions ) {
74+ func VerifyString (t core.Failable , s string , opts ... VerifyOptions ) {
7575 t .Helper ()
7676 reader := strings .NewReader (s )
7777 Verify (t , reader , opts ... )
@@ -80,7 +80,7 @@ func VerifyString(t core.Failable, s string, opts ...verifyOptions) {
8080// VerifyXMLStruct Example:
8181//
8282// VerifyXMLStruct(t, xml)
83- func VerifyXMLStruct (t core.Failable , obj interface {}, opts ... verifyOptions ) {
83+ func VerifyXMLStruct (t core.Failable , obj interface {}, opts ... VerifyOptions ) {
8484 t .Helper ()
8585 options := alwaysOption (opts ).ForFile ().WithExtension (".xml" )
8686 xmlContent , err := xml .MarshalIndent (obj , "" , " " )
@@ -99,7 +99,7 @@ func VerifyXMLStruct(t core.Failable, obj interface{}, opts ...verifyOptions) {
9999// VerifyXMLBytes Example:
100100//
101101// VerifyXMLBytes(t, []byte("<Test/>"))
102- func VerifyXMLBytes (t core.Failable , bs []byte , opts ... verifyOptions ) {
102+ func VerifyXMLBytes (t core.Failable , bs []byte , opts ... VerifyOptions ) {
103103 t .Helper ()
104104 type node struct {
105105 Attr []xml.Attr
@@ -121,7 +121,7 @@ func VerifyXMLBytes(t core.Failable, bs []byte, opts ...verifyOptions) {
121121// VerifyJSONStruct Example:
122122//
123123// VerifyJSONStruct(t, json)
124- func VerifyJSONStruct (t core.Failable , obj interface {}, opts ... verifyOptions ) {
124+ func VerifyJSONStruct (t core.Failable , obj interface {}, opts ... VerifyOptions ) {
125125 t .Helper ()
126126 options := alwaysOption (opts ).ForFile ().WithExtension (".json" )
127127 jsonb , err := json .MarshalIndent (obj , "" , " " )
@@ -136,7 +136,7 @@ func VerifyJSONStruct(t core.Failable, obj interface{}, opts ...verifyOptions) {
136136// VerifyJSONBytes Example:
137137//
138138// VerifyJSONBytes(t, []byte("{ \"Greeting\": \"Hello\" }"))
139- func VerifyJSONBytes (t core.Failable , bs []byte , opts ... verifyOptions ) {
139+ func VerifyJSONBytes (t core.Failable , bs []byte , opts ... VerifyOptions ) {
140140 t .Helper ()
141141 var obj map [string ]interface {}
142142 err := json .Unmarshal (bs , & obj )
@@ -151,7 +151,7 @@ func VerifyJSONBytes(t core.Failable, bs []byte, opts ...verifyOptions) {
151151// VerifyMap Example:
152152//
153153// VerifyMap(t, map[string][string] { "dog": "bark" })
154- func VerifyMap (t core.Failable , m interface {}, opts ... verifyOptions ) {
154+ func VerifyMap (t core.Failable , m interface {}, opts ... VerifyOptions ) {
155155 t .Helper ()
156156 outputText := utils .PrintMap (m )
157157 VerifyString (t , outputText , opts ... )
@@ -160,7 +160,7 @@ func VerifyMap(t core.Failable, m interface{}, opts ...verifyOptions) {
160160// VerifyArray Example:
161161//
162162// VerifyArray(t, []string{"dog", "cat"})
163- func VerifyArray (t core.Failable , array interface {}, opts ... verifyOptions ) {
163+ func VerifyArray (t core.Failable , array interface {}, opts ... VerifyOptions ) {
164164 t .Helper ()
165165 outputText := utils .PrintArray (array )
166166 VerifyString (t , outputText , opts ... )
@@ -169,7 +169,7 @@ func VerifyArray(t core.Failable, array interface{}, opts ...verifyOptions) {
169169// VerifyAll Example:
170170//
171171// VerifyAll(t, "uppercase", []string("dog", "cat"}, func(x interface{}) string { return strings.ToUpper(x.(string)) })
172- func VerifyAll (t core.Failable , header string , collection interface {}, transform func (interface {}) string , opts ... verifyOptions ) {
172+ func VerifyAll (t core.Failable , header string , collection interface {}, transform func (interface {}) string , opts ... VerifyOptions ) {
173173 t .Helper ()
174174 if len (header ) != 0 {
175175 header = fmt .Sprintf ("%s\n \n \n " , header )
0 commit comments