Skip to content

Commit d3a95fb

Browse files
committed
start: fix findGoBin out of range panic
https://github.com/prutonis #5
1 parent 0c14c6b commit d3a95fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

start/start.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"os/exec"
1919
"os/signal"
2020
"path/filepath"
21+
"strings"
2122
"text/template"
2223

2324
"gopkg.in/yaml.v3"
@@ -258,7 +259,7 @@ func findGoBin(goBin *string, path string) {
258259

259260
for _, dir := range dirs {
260261
// Check if directory name starts with `go`.
261-
if dir.Name()[:2] != "go" || !dir.IsDir() {
262+
if !strings.HasPrefix(dir.Name(), "go") || !dir.IsDir() {
262263
continue
263264
}
264265

0 commit comments

Comments
 (0)