From 77cd0ae36e79748b56e9bf0964fee677631f9fd0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 4 Dec 2024 15:37:31 -0600 Subject: always run goimports. misc other changes --- goDep.redoGoMod.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'goDep.redoGoMod.go') diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go index 7e56989..6aeb298 100644 --- a/goDep.redoGoMod.go +++ b/goDep.redoGoMod.go @@ -5,7 +5,6 @@ package gitpb import ( "errors" "os" - "strings" "go.wit.com/log" ) @@ -67,41 +66,6 @@ func (repo *Repo) RedoGoMod() (bool, error) { return false, errors.New("MakeRedomod() logic failed") } -func (repo *Repo) RepoType() string { - if repo == nil { - return "nil" - } - if repo.GetGoPlugin() { - return "plugin" - } - if repo.GetGoBinary() { - return "binary" - } - if ok, _, _ := repo.IsProtobuf(); ok { - return "protobuf" - } - if repo.GetGoLibrary() { - return "library" - } - return "" -} - -func (repo *Repo) goListRepoType() string { - os.Setenv("GO111MODULE", "off") - cmd := []string{"go", "list", "-f", "'{{if eq .Name \"main\"}}binary{{else}}library{{end}}'"} - // cmd := []string{"go", "list", "-f", "'{{.Name}}'"} // probably use this. this just prints out the package name - // cmd := []string{"go", "list", "-f", "'{{.ImportPath}}'"} // returns go.wit.com/lib/protobuf/gitpb - - result := repo.RunQuiet(cmd) - if result.Error != nil { - log.Warn("go list binary detect failed", result.Error) - return "" - } - output := strings.TrimSpace(strings.Join(result.Stdout, "\n")) - output = strings.Trim(output, "'") - return output -} - // returns true if the last published func (repo *Repo) GoDepsLen() int { if repo.GoDeps == nil { -- cgit v1.2.3