diff options
Diffstat (limited to 'common.go')
| -rw-r--r-- | common.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -1,6 +1,7 @@ package repostatus import ( + "os" "strings" "unicode" @@ -111,10 +112,15 @@ func (rs *RepoStatus) IsGoLang() bool { return false } +// experiment to go package type func (rs *RepoStatus) RepoType() string { if !rs.IsGoLang() { return "" } + if !rs.Exists("go.mod") { + return "" + } + os.Setenv("GO111MODULE", "off") err, output := rs.RunCmd([]string{"go", "list", "-f", "'{{if eq .Name \"main\"}}binary{{else}}library{{end}}'"}) if err == nil { output = strings.Trim(output, "'") |
