func NewPackage(sysPackage system.Package) *Package { name := sysPackage.Name() versions, _ := sysPackage.Versions() installed, _ := sysPackage.Installed() return &Package{ Name: name, Versions: versions, Installed: installed.(bool), } }
func NewPackage(sysPackage system.Package, config util.Config) (*Package, error) { name := sysPackage.Name() installed, _ := sysPackage.Installed() p := &Package{ Name: name, Installed: installed.(bool), } if !contains(config.IgnoreList, "versions") { versions, _ := sysPackage.Versions() p.Versions = versions } return p, nil }
func NewPackage(sysPackage system.Package, ignoreList []string) *Package { name := sysPackage.Name() installed, _ := sysPackage.Installed() p := &Package{ Name: name, Installed: installed.(bool), } if !contains(ignoreList, "versions") { versions, _ := sysPackage.Versions() p.Versions = versions } return p }