Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>
  • Loading branch information
shmsr committed Jun 10, 2022
1 parent 2d58b05 commit 26ff104
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os/exec"
"regexp"
"runtime"
"strings"

"github.com/ChrisTrenkamp/goxpath"
"github.com/ChrisTrenkamp/goxpath/tree"
Expand Down Expand Up @@ -322,3 +323,28 @@ func sccSA4021(x, y []int) {

x = y
}

func goW1008() {
str := "hello@deepsource.io@test"

m := make(map[int]string)
m[1] = str

test := -2

// Just here to get more coverage
if test == -1 {
return
}

idx1, idx2 := strings.Index(str, "@"), strings.Index(str, "@") // want "strings.Index used to cut a string"
_, _ = str[:idx1], str[idx1+1:]
_, _ = str[:idx2], str[idx2+1:]

idx := strings.Index(str, "@") // want "strings.Index used to cut a string"
if idx == -1 {
return
}
_, v := str[:idx], str[idx+1:]
_ = v
}

0 comments on commit 26ff104

Please sign in to comment.