From eee32f324c766db9a2bdcc9134fbba14110a5c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 23 Sep 2020 19:55:11 +0200 Subject: [PATCH] Fix AskStubber erroring out when there are more asks than stubs --- pkg/prompt/stubber.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/prompt/stubber.go b/pkg/prompt/stubber.go index 77d37b350..ab08cd1ab 100644 --- a/pkg/prompt/stubber.go +++ b/pkg/prompt/stubber.go @@ -26,7 +26,7 @@ func InitAskStubber() (*AskStubber, func()) { as.AskOnes = append(as.AskOnes, &p) count := as.OneCount as.OneCount += 1 - if count > len(as.StubOnes) { + if count >= len(as.StubOnes) { panic(fmt.Sprintf("more asks than stubs. most recent call: %v", p)) } stubbedPrompt := as.StubOnes[count]