fix FindVersion()
This commit is contained in:
parent
98ba8076ae
commit
1c479b61f6
14
wit.go
14
wit.go
|
@ -32,7 +32,19 @@ func (m *Machine) FindInstalledByName(name string) *Package {
|
|||
|
||||
// looks to see if any package matches a name and version
|
||||
// if version == "", return the first name found
|
||||
func (m *Machine) FindVersion(name string, version string) *Package {
|
||||
func (m *Machine) FindVersion(name string) string {
|
||||
// first check all installed versions
|
||||
for p := range m.Packages.IterByName() {
|
||||
if name == p.Name {
|
||||
return p.Version
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// looks to see if any package matches a name and version
|
||||
// if version == "", return the first name found
|
||||
func (m *Machine) FindByVersion(name string, version string) *Package {
|
||||
// first check all installed versions
|
||||
for p := range m.Packages.IterByName() {
|
||||
if name == p.Name {
|
||||
|
|
Loading…
Reference in New Issue