Skip to content

Commit da1e147

Browse files
authored
Merge branch 'master' into master
2 parents f1b5324 + 3c302f7 commit da1e147

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

mock/mock.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ const (
764764
)
765765

766766
// AnythingOfTypeArgument contains the type of an argument
767-
// for use when type checking. Used in Diff and Assert.
767+
// for use when type checking. Used in [Arguments.Diff] and [Arguments.Assert].
768768
//
769769
// Deprecated: this is an implementation detail that must not be used. Use [AnythingOfType] instead.
770770
type AnythingOfTypeArgument = anythingOfTypeArgument
@@ -780,24 +780,25 @@ type anythingOfTypeArgument string
780780
//
781781
// For example:
782782
//
783-
// Assert(t, AnythingOfType("string"), AnythingOfType("int"))
783+
// args.Assert(t, AnythingOfType("string"), AnythingOfType("int"))
784784
func AnythingOfType(t string) AnythingOfTypeArgument {
785785
return anythingOfTypeArgument(t)
786786
}
787787

788788
// IsTypeArgument is a struct that contains the type of an argument
789-
// for use when type checking. This is an alternative to AnythingOfType.
790-
// Used in Diff and Assert.
789+
// for use when type checking. This is an alternative to [AnythingOfType].
790+
// Used in [Arguments.Diff] and [Arguments.Assert].
791791
type IsTypeArgument struct {
792792
t reflect.Type
793793
}
794794

795795
// IsType returns an IsTypeArgument object containing the type to check for.
796796
// You can provide a zero-value of the type to check. This is an
797-
// alternative to AnythingOfType. Used in Diff and Assert.
797+
// alternative to [AnythingOfType]. Used in [Arguments.Diff] and [Arguments.Assert].
798798
//
799799
// For example:
800-
// Assert(t, IsType(""), IsType(0))
800+
//
801+
// args.Assert(t, IsType(""), IsType(0))
801802
func IsType(t interface{}) *IsTypeArgument {
802803
return &IsTypeArgument{t: reflect.TypeOf(t)}
803804
}
@@ -874,10 +875,11 @@ func (f argumentMatcher) String() string {
874875
// and false otherwise.
875876
//
876877
// Example:
877-
// m.On("Do", MatchedBy(func(req *http.Request) bool { return req.Host == "example.com" }))
878878
//
879-
// |fn|, must be a function accepting a single argument (of the expected type)
880-
// which returns a bool. If |fn| doesn't match the required signature,
879+
// m.On("Do", MatchedBy(func(req *http.Request) bool { return req.Host == "example.com" }))
880+
//
881+
// fn must be a function accepting a single argument (of the expected type)
882+
// which returns a bool. If fn doesn't match the required signature,
881883
// MatchedBy() panics.
882884
func MatchedBy(fn interface{}) argumentMatcher {
883885
fnType := reflect.TypeOf(fn)

0 commit comments

Comments
 (0)