...
1 package internal
2
3 import (
4 "fmt"
5
6 "github.com/onsi/gomega/types"
7 )
8
9
10
11
12
13 func vetOptionalDescription(assertion string, optionalDescription ...interface{}) {
14 if len(optionalDescription) == 0 {
15 return
16 }
17 if _, isGomegaMatcher := optionalDescription[0].(types.GomegaMatcher); isGomegaMatcher {
18 panic(fmt.Sprintf("%s has a GomegaMatcher as the first element of optionalDescription.\n\t"+
19 "Do you mean to use And/Or/SatisfyAll/SatisfyAny to combine multiple matchers?",
20 assertion))
21 }
22 }
23
View as plain text