@@ -831,7 +831,7 @@ const (
831
831
)
832
832
833
833
// AnythingOfTypeArgument contains the type of an argument
834
- // for use when type checking. Used in Diff and Assert.
834
+ // for use when type checking. Used in [Arguments. Diff] and [Arguments. Assert] .
835
835
//
836
836
// Deprecated: this is an implementation detail that must not be used. Use [AnythingOfType] instead.
837
837
type AnythingOfTypeArgument = anythingOfTypeArgument
@@ -847,24 +847,25 @@ type anythingOfTypeArgument string
847
847
//
848
848
// For example:
849
849
//
850
- // Assert(t, AnythingOfType("string"), AnythingOfType("int"))
850
+ // args. Assert(t, AnythingOfType("string"), AnythingOfType("int"))
851
851
func AnythingOfType (t string ) AnythingOfTypeArgument {
852
852
return anythingOfTypeArgument (t )
853
853
}
854
854
855
855
// IsTypeArgument is a struct that contains the type of an argument
856
- // for use when type checking. This is an alternative to AnythingOfType.
857
- // Used in Diff and Assert.
856
+ // for use when type checking. This is an alternative to [ AnythingOfType] .
857
+ // Used in [Arguments. Diff] and [Arguments. Assert] .
858
858
type IsTypeArgument struct {
859
859
t reflect.Type
860
860
}
861
861
862
862
// IsType returns an IsTypeArgument object containing the type to check for.
863
863
// You can provide a zero-value of the type to check. This is an
864
- // alternative to AnythingOfType. Used in Diff and Assert.
864
+ // alternative to [ AnythingOfType] . Used in [Arguments. Diff] and [Arguments. Assert] .
865
865
//
866
866
// For example:
867
- // Assert(t, IsType(""), IsType(0))
867
+ //
868
+ // args.Assert(t, IsType(""), IsType(0))
868
869
func IsType (t interface {}) * IsTypeArgument {
869
870
return & IsTypeArgument {t : reflect .TypeOf (t )}
870
871
}
@@ -886,8 +887,8 @@ func (f *FunctionalOptionsArgument) String() string {
886
887
return strings .Replace (fmt .Sprintf ("%#v" , f .value ), "[]interface {}" , name , 1 )
887
888
}
888
889
889
- // FunctionalOptions returns an FunctionalOptionsArgument object containing the functional option type
890
- // and the values to check of
890
+ // FunctionalOptions returns an [ FunctionalOptionsArgument] object containing the functional option type
891
+ // and the values to check of.
891
892
//
892
893
// For example:
893
894
// Assert(t, FunctionalOptions("[]foo.FunctionalOption", foo.Opt1(), foo.Opt2()))
@@ -940,10 +941,11 @@ func (f argumentMatcher) String() string {
940
941
// and false otherwise.
941
942
//
942
943
// Example:
943
- // m.On("Do", MatchedBy(func(req *http.Request) bool { return req.Host == "example.com" }))
944
944
//
945
- // |fn|, must be a function accepting a single argument (of the expected type)
946
- // which returns a bool. If |fn| doesn't match the required signature,
945
+ // m.On("Do", MatchedBy(func(req *http.Request) bool { return req.Host == "example.com" }))
946
+ //
947
+ // fn must be a function accepting a single argument (of the expected type)
948
+ // which returns a bool. If fn doesn't match the required signature,
947
949
// MatchedBy() panics.
948
950
func MatchedBy (fn interface {}) argumentMatcher {
949
951
fnType := reflect .TypeOf (fn )
0 commit comments