Skip to content

Commit

Permalink
fix(threads): fix sending just ")" when "..." are present (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKepczynskiSauce authored Nov 28, 2024
1 parent 1164657 commit e5a7961
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ func readFileGetSourceCode(path string) SourceCode {
}

func getLastPathIndexAndFunction(line string) (int, string) {
if strings.HasSuffix(line, ")") {
lastIndex := strings.LastIndex(line, "(")
if lastIndex != -1 {
line = line[:lastIndex]
}
}

lastIndex := strings.LastIndex(line, ".")
function, _, _ := strings.Cut(line[lastIndex+1:], "(")
return lastIndex, function
Expand Down

0 comments on commit e5a7961

Please sign in to comment.