Skip to content

Commit

Permalink
Merge pull request #136 from rkscv/polishing
Browse files Browse the repository at this point in the history
Polishing
  • Loading branch information
nao1215 committed Mar 24, 2024
2 parents 117823e + 7fda027 commit 9f86d80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ func printPackageList(pkgs []goutil.Package) {
fmt.Fprintf(print.Stdout, "%"+strconv.Itoa(max)+"s: %s%s\n",
v.Name,
v.ImportPath,
color.GreenString("@"+goutil.GetPackageVersion(v.Name)))
color.GreenString("@"+v.Version.Current))
}
}
11 changes: 2 additions & 9 deletions internal/goutil/goutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ func NewVersion() *Version {
}
}

// SetCurrentVer set package current version.
func (p *Package) SetCurrentVer() {
p.Version.Current = GetPackageVersion(p.Name)
}

// SetLatestVer set package latest version.
func (p *Package) SetLatestVer() {
p.Version.Latest = GetPackageVersion(p.Name)
Expand Down Expand Up @@ -174,9 +169,7 @@ func (gp *GoPaths) EndDryRunMode() error {
// removeTmpDir remove tmporary directory for dry run
func (gp *GoPaths) removeTmpDir() error {
if gp.TmpPath != "" {
if err := os.RemoveAll(gp.TmpPath); err != nil {
return err
}
return os.RemoveAll(gp.TmpPath)
}
return nil
}
Expand Down Expand Up @@ -307,7 +300,7 @@ func GetPackageInformation(binList []string) []Package {
ModulePath: info.Main.Path,
Version: NewVersion(),
}
pkg.SetCurrentVer()
pkg.Version.Current = info.Main.Version
pkgs = append(pkgs, pkg)
}
return pkgs
Expand Down

0 comments on commit 9f86d80

Please sign in to comment.