Return errors from all distro's New() functions instead of logging and returning nil. Also, return errors instead of panicking from NewRegistry() and NewDefaultRegistry().
14 lines
343 B
Go
14 lines
343 B
Go
package distro_mock
|
|
|
|
import (
|
|
"github.com/osbuild/osbuild-composer/internal/distro"
|
|
"github.com/osbuild/osbuild-composer/internal/distro/fedoratest"
|
|
)
|
|
|
|
func NewDefaultRegistry() (*distro.Registry, error) {
|
|
ftest := fedoratest.New()
|
|
if ftest == nil {
|
|
panic("Attempt to register Fedora test failed")
|
|
}
|
|
return distro.NewRegistry(ftest)
|
|
}
|