From 10dd74b4afa545fddfab27b1d9265fca4d7b4bb1 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Thu, 9 Mar 2023 15:36:15 -0800 Subject: [PATCH] fix bug with Prompter.MultiSelect --- internal/prompter/prompter.go | 4 ++-- internal/prompter/prompter_mock.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/prompter/prompter.go b/internal/prompter/prompter.go index 005478e86..a9cf77992 100644 --- a/internal/prompter/prompter.go +++ b/internal/prompter/prompter.go @@ -13,7 +13,7 @@ import ( //go:generate moq -rm -out prompter_mock.go . Prompter type Prompter interface { Select(string, string, []string) (int, error) - MultiSelect(string, string, []string) (int, error) + MultiSelect(string, string, []string) ([]string, error) Input(string, string) (string, error) InputHostname() (string, error) Password(string) (string, error) @@ -72,7 +72,7 @@ func (p *surveyPrompter) Select(message, defaultValue string, options []string) return } -func (p *surveyPrompter) MultiSelect(message, defaultValue string, options []string) (result int, err error) { +func (p *surveyPrompter) MultiSelect(message, defaultValue string, options []string) (result []string, err error) { q := &survey.MultiSelect{ Message: message, Options: options, diff --git a/internal/prompter/prompter_mock.go b/internal/prompter/prompter_mock.go index 999922978..859832450 100644 --- a/internal/prompter/prompter_mock.go +++ b/internal/prompter/prompter_mock.go @@ -35,7 +35,7 @@ var _ Prompter = &PrompterMock{} // MarkdownEditorFunc: func(s1 string, s2 string, b bool) (string, error) { // panic("mock out the MarkdownEditor method") // }, -// MultiSelectFunc: func(s1 string, s2 string, strings []string) (int, error) { +// MultiSelectFunc: func(s1 string, s2 string, strings []string) ([]string, error) { // panic("mock out the MultiSelect method") // }, // PasswordFunc: func(s string) (string, error) { @@ -70,7 +70,7 @@ type PrompterMock struct { MarkdownEditorFunc func(s1 string, s2 string, b bool) (string, error) // MultiSelectFunc mocks the MultiSelect method. - MultiSelectFunc func(s1 string, s2 string, strings []string) (int, error) + MultiSelectFunc func(s1 string, s2 string, strings []string) ([]string, error) // PasswordFunc mocks the Password method. PasswordFunc func(s string) (string, error) @@ -348,7 +348,7 @@ func (mock *PrompterMock) MarkdownEditorCalls() []struct { } // MultiSelect calls MultiSelectFunc. -func (mock *PrompterMock) MultiSelect(s1 string, s2 string, strings []string) (int, error) { +func (mock *PrompterMock) MultiSelect(s1 string, s2 string, strings []string) ([]string, error) { if mock.MultiSelectFunc == nil { panic("PrompterMock.MultiSelectFunc: method is nil but Prompter.MultiSelect was just called") }