feat: change interface from ID()/Release() to Distro() with both
This commit is contained in:
@ -29,18 +29,14 @@ type OracleLinux struct {
|
||||
container string
|
||||
}
|
||||
|
||||
func (ol OracleLinux) ID() distro.ID {
|
||||
return distro.OracleLinux
|
||||
}
|
||||
|
||||
func (ol OracleLinux) Release() string {
|
||||
return ol.release
|
||||
}
|
||||
|
||||
func (ol OracleLinux) Equal(d distro.Distro) bool {
|
||||
return ol.release == d.Release && distro.OracleLinux == d.ID
|
||||
}
|
||||
|
||||
func (ol OracleLinux) Distro() distro.Distro {
|
||||
return distro.Distro{ID: distro.OracleLinux, Release: ol.release}
|
||||
}
|
||||
|
||||
func (ol OracleLinux) Packages() (pkgs []string, err error) {
|
||||
c, err := container.New(ol.container)
|
||||
if err != nil {
|
||||
|
@ -13,8 +13,6 @@ func TestOracleLinux(t *testing.T) {
|
||||
|
||||
u := OracleLinux{release: "9", container: "out_of_tree_oraclelinux_9"}
|
||||
|
||||
assert.Equal(u.ID(), distro.OracleLinux)
|
||||
assert.Equal(u.Release(), "9")
|
||||
|
||||
assert.True(u.Equal(distro.Distro{Release: "9", ID: distro.OracleLinux}))
|
||||
|
||||
|
Reference in New Issue
Block a user