Skip to content

Commit

Permalink
dont wrap error
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Nov 24, 2024
1 parent 19c9c1e commit 4f2cec4
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,18 @@ var (
shellCompletions = map[string]renderCompletion{
"bash": func(c *Command, appName string) (string, error) {
b, err := autoCompleteFS.ReadFile("autocomplete/bash_autocomplete")
if err != nil {
return "", fmt.Errorf("read file: %w", err)
}
return fmt.Sprintf(string(b), appName), nil
return fmt.Sprintf(string(b), appName), err
},
"zsh": func(c *Command, appName string) (string, error) {
b, err := autoCompleteFS.ReadFile("autocomplete/zsh_autocomplete")
if err != nil {
return "", fmt.Errorf("read file: %w", err)
}
return fmt.Sprintf(string(b), appName), nil
return fmt.Sprintf(string(b), appName), err
},
"fish": func(c *Command, appName string) (string, error) {
return c.ToFishCompletion()
},
"pwsh": func(c *Command, appName string) (string, error) {
b, err := autoCompleteFS.ReadFile("autocomplete/powershell_autocomplete.ps1")
if err != nil {
return "", fmt.Errorf("read file: %w", err)
}
return string(b), nil
return string(b), err
},
}
)
Expand Down

0 comments on commit 4f2cec4

Please sign in to comment.