Use functional options to construct driver root

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2024-02-14 14:29:05 +01:00
parent 1ddc859700
commit 93763d25f0
4 changed files with 59 additions and 13 deletions

View File

@@ -93,8 +93,11 @@ func New(opts ...Option) (Interface, error) {
l.infolib = info.New()
}
// TODO: We need to improve the construction of this driver root.
l.driver = root.New(l.logger, l.driverRoot, l.librarySearchPaths)
l.driver = root.New(
root.WithLogger(l.logger),
root.WithDriverRoot(l.driverRoot),
root.WithLibrarySearchPaths(l.librarySearchPaths...),
)
var lib Interface
switch l.resolveMode() {