Skip to content

Commit

Permalink
add linting docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec committed Nov 9, 2020
1 parent 198dcba commit 3b93fae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,23 @@ func IsType(t interface{}) *IsTypeArgument {
return &IsTypeArgument{t: t}
}

// FunctionalOptionsArgument is a struct that contains the type and value of an functional option argument
// for use when type checking.
type FunctionalOptionsArgument struct {
name string
value interface{}
}

// String returns the string representation of FunctionalOptionsArgument
func (f *FunctionalOptionsArgument) String() string {
return strings.Replace(fmt.Sprintf("%#v", f.value), "[]interface {}", f.name, 1)
}

// FunctionalOptions returns an FunctionalOptionsArgument object containing the functional option type
// and the values to check of
//
// For example:
// Assert(t, FunctionalOptions("[]foo.FunctionalOption", foo.Opt1(), foo.Opt2()))
func FunctionalOptions(name string, value ...interface{}) *FunctionalOptionsArgument {
return &FunctionalOptionsArgument{
name: name,
Expand Down

0 comments on commit 3b93fae

Please sign in to comment.