diff options
| author | Jeff Carr <[email protected]> | 2024-03-07 19:31:52 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-03-07 19:31:52 -0600 |
| commit | 2cdf2c3cdaffd62d28cc3e797aeba9159709dc03 (patch) | |
| tree | 64303abe665f75172b40c9165e54b4dffdb2ab8b /common.go | |
| parent | f99dc30b683e55fe87f1273febb2be42c844bd54 (diff) | |
working on go-clonev0.22.1
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, "'") |
