fix: apply options when constructing an instance of the nvcdi library

Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
This commit is contained in:
Christopher Desiniotis 2023-02-14 16:32:40 -08:00
parent b6bab4d3fd
commit a52c9f0ac6

View File

@ -37,6 +37,9 @@ type nvcdilib struct {
// New creates a new nvcdi library
func New(opts ...Option) Interface {
l := &nvcdilib{}
for _, opt := range opts {
opt(l)
}
if l.nvmllib == nil {
l.nvmllib = nvml.New()