podman

Форк
0
22 строки · 741.0 Байт
1
package internal
2

3
import (
4
	"fmt"
5

6
	"github.com/onsi/gomega/types"
7
)
8

9
// vetOptionalDescription vets the optional description args: if it finds any
10
// Gomega matcher at the beginning it panics. This allows for rendering Gomega
11
// matchers as part of an optional Description, as long as they're not in the
12
// first slot.
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

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.