Skip to content

Commit

Permalink
start: fix findGoBin out of range panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Curid committed Apr 16, 2024
1 parent 0c14c6b commit d3a95fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"os/exec"
"os/signal"
"path/filepath"
"strings"
"text/template"

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

for _, dir := range dirs {
// Check if directory name starts with `go`.
if dir.Name()[:2] != "go" || !dir.IsDir() {
if !strings.HasPrefix(dir.Name(), "go") || !dir.IsDir() {
continue
}

Expand Down

0 comments on commit d3a95fb

Please sign in to comment.