My goal is to add a method to distroregistry to return Registry with all supported distributions. This way, all supported distributions would be defined only on one place. To achieve this, the Registry must live outside the distro package because the distro implementation depends on it and this would create a circular dependency unsupported by Go. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
14 lines
359 B
Go
14 lines
359 B
Go
package distro_mock
|
|
|
|
import (
|
|
"github.com/osbuild/osbuild-composer/internal/distro/fedoratest"
|
|
"github.com/osbuild/osbuild-composer/internal/distroregistry"
|
|
)
|
|
|
|
func NewDefaultRegistry() (*distroregistry.Registry, error) {
|
|
ftest := fedoratest.New()
|
|
if ftest == nil {
|
|
panic("Attempt to register Fedora test failed")
|
|
}
|
|
return distroregistry.New(ftest)
|
|
}
|