Skip to content

Commit

Permalink
Add runtime.GOOS and runtime.GOARCH to doctor check (#498)
Browse files Browse the repository at this point in the history
Add runtime.GOOS and runtime.GOARCH to doctor check
  • Loading branch information
twpayne committed Nov 29, 2019
2 parents 59f708c + 13398a8 commit 97258b3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmd/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strings"

"github.com/coreos/go-semver/semver"
Expand Down Expand Up @@ -69,6 +70,8 @@ type doctorFileCheck struct {
info os.FileInfo
}

type doctorRuntimeCheck struct{}

type doctorSuspiciousFilesCheck struct {
path string
filenames map[string]bool
Expand Down Expand Up @@ -110,6 +113,7 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error {
allOK := true
for _, dc := range []doctorCheck{
&doctorVersionCheck{},
&doctorRuntimeCheck{},
&doctorDirectoryCheck{
name: "source directory",
path: c.SourceDir,
Expand Down Expand Up @@ -369,6 +373,26 @@ func (c *doctorFileCheck) Skip() bool {
return c.canSkip && c.path == ""
}

func (doctorRuntimeCheck) Check() (bool, error) {
return true, nil
}

func (doctorRuntimeCheck) Enabled() bool {
return true
}

func (doctorRuntimeCheck) MustSucceed() bool {
return true
}

func (doctorRuntimeCheck) Result() string {
return fmt.Sprintf("runtime.GOOS %s, runtime.GOARCH %s", runtime.GOOS, runtime.GOARCH)
}

func (doctorRuntimeCheck) Skip() bool {
return false
}

func (c *doctorSuspiciousFilesCheck) Check() (bool, error) {
if err := filepath.Walk(c.path, func(path string, info os.FileInfo, err error) error {
if err != nil {
Expand Down

0 comments on commit 97258b3

Please sign in to comment.