Skip to content

Commit 97258b3

Browse files
authored
Add runtime.GOOS and runtime.GOARCH to doctor check (#498)
Add runtime.GOOS and runtime.GOARCH to doctor check
2 parents 59f708c + 13398a8 commit 97258b3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cmd/doctor.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os/exec"
77
"path/filepath"
88
"regexp"
9+
"runtime"
910
"strings"
1011

1112
"github.com/coreos/go-semver/semver"
@@ -69,6 +70,8 @@ type doctorFileCheck struct {
6970
info os.FileInfo
7071
}
7172

73+
type doctorRuntimeCheck struct{}
74+
7275
type doctorSuspiciousFilesCheck struct {
7376
path string
7477
filenames map[string]bool
@@ -110,6 +113,7 @@ func (c *Config) runDoctorCmd(cmd *cobra.Command, args []string) error {
110113
allOK := true
111114
for _, dc := range []doctorCheck{
112115
&doctorVersionCheck{},
116+
&doctorRuntimeCheck{},
113117
&doctorDirectoryCheck{
114118
name: "source directory",
115119
path: c.SourceDir,
@@ -369,6 +373,26 @@ func (c *doctorFileCheck) Skip() bool {
369373
return c.canSkip && c.path == ""
370374
}
371375

376+
func (doctorRuntimeCheck) Check() (bool, error) {
377+
return true, nil
378+
}
379+
380+
func (doctorRuntimeCheck) Enabled() bool {
381+
return true
382+
}
383+
384+
func (doctorRuntimeCheck) MustSucceed() bool {
385+
return true
386+
}
387+
388+
func (doctorRuntimeCheck) Result() string {
389+
return fmt.Sprintf("runtime.GOOS %s, runtime.GOARCH %s", runtime.GOOS, runtime.GOARCH)
390+
}
391+
392+
func (doctorRuntimeCheck) Skip() bool {
393+
return false
394+
}
395+
372396
func (c *doctorSuspiciousFilesCheck) Check() (bool, error) {
373397
if err := filepath.Walk(c.path, func(path string, info os.FileInfo, err error) error {
374398
if err != nil {

0 commit comments

Comments
 (0)