From a6468b964c4798e8943ae5cfe44fb7397c8124da Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sat, 27 Apr 2024 15:48:39 +0300 Subject: [PATCH] [terminal/input] Fix usage examples --- .github/workflows/ci.yml | 2 -- terminal/input/example_test.go | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c5afd19..b9138e0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,8 +168,6 @@ jobs: name: Typos runs-on: ubuntu-latest - needs: SendCoverage - steps: - name: Checkout uses: actions/checkout@v4 diff --git a/terminal/input/example_test.go b/terminal/input/example_test.go index df665fe0..51caf1ea 100644 --- a/terminal/input/example_test.go +++ b/terminal/input/example_test.go @@ -119,7 +119,7 @@ func ExampleSetHistoryCapacity() { func ExampleSetCompletionHandler() { commands := []string{"add", "delete", "search", "help", "quit"} - input.SetCompletionHandler(func(input string) []string { + SetCompletionHandler(func(input string) []string { var result []string for _, c := range commands { @@ -131,7 +131,7 @@ func ExampleSetCompletionHandler() { return result }) - input.SetHintHandler(func(input string) string { + SetHintHandler(func(input string) string { for _, c := range commands { if strings.HasPrefix(c, input) { return c[len(input):] @@ -141,7 +141,7 @@ func ExampleSetCompletionHandler() { return "" }) - input, err := input.Read("Please enter command", true) + input, err := Read("Please enter command", true) if err != nil { fmt.Printf("Error: %v\n", err) @@ -154,7 +154,7 @@ func ExampleSetCompletionHandler() { func ExampleSetHintHandler() { commands := []string{"add", "delete", "search", "help", "quit"} - input.SetCompletionHandler(func(input string) []string { + SetCompletionHandler(func(input string) []string { var result []string for _, c := range commands { @@ -166,7 +166,7 @@ func ExampleSetHintHandler() { return result }) - input.SetHintHandler(func(input string) string { + SetHintHandler(func(input string) string { for _, c := range commands { if strings.HasPrefix(c, input) { return c[len(input):] @@ -176,7 +176,7 @@ func ExampleSetHintHandler() { return "" }) - input, err := input.Read("Please enter command", true) + input, err := Read("Please enter command", true) if err != nil { fmt.Printf("Error: %v\n", err)