Skip to content

Commit

Permalink
Remove useless statement
Browse files Browse the repository at this point in the history
  • Loading branch information
antham committed Jun 24, 2024
1 parent 79ef266 commit a2bec63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ func newShellParser() *shellParser {

func (shellParser *shellParser) parse(content []byte) []Function {
functions := []Function{}
r := regexp.MustCompile(`(?m)(?:#\s*(?P<description>.+)\n)?(?:(?P<function_2>.*)\s*\(\))(?:\s*|\n)?{`)
r := regexp.MustCompile(`(?m)(?:#\s*(?P<description>.+)\n)?(?:(?P<function>.*)\s*\(\))(?:\s*|\n)?{`)
for _, match := range r.FindAllSubmatch(content, -1) {
function := Function{}
for i, name := range r.SubexpNames() {
if i != 0 && name != "" {
switch name {
case "function_1", "function_2":
case "function":
if len(match[i]) == 0 {
continue
}
Expand Down

0 comments on commit a2bec63

Please sign in to comment.