mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-02-16 17:42:20 +00:00
Fix lint errors
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
201232dae3
commit
707e3479f8
@ -117,7 +117,7 @@ func (m command) validateFlags(r *cli.Context, cfg *config) error {
|
|||||||
return fmt.Errorf("invalid output format: %v", cfg.format)
|
return fmt.Errorf("invalid output format: %v", cfg.format)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := NewDeviceNamer(cfg.deviceNameStrategy)
|
_, err := newDeviceNamer(cfg.deviceNameStrategy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ func (m command) validateFlags(r *cli.Context, cfg *config) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m command) run(c *cli.Context, cfg *config) error {
|
func (m command) run(c *cli.Context, cfg *config) error {
|
||||||
deviceNamer, err := NewDeviceNamer(cfg.deviceNameStrategy)
|
deviceNamer, err := newDeviceNamer(cfg.deviceNameStrategy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create device namer: %v", err)
|
return fmt.Errorf("failed to create device namer: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,9 @@ type deviceNameIndex struct {
|
|||||||
}
|
}
|
||||||
type deviceNameUUID struct{}
|
type deviceNameUUID struct{}
|
||||||
|
|
||||||
// NewDeviceNamer creates a Device Namer based on the supplied strategy.
|
// newDeviceNamer creates a Device Namer based on the supplied strategy.
|
||||||
// This namer can be used to construct the names for MIG and GPU devices when generating the CDI spec.
|
// This namer can be used to construct the names for MIG and GPU devices when generating the CDI spec.
|
||||||
func NewDeviceNamer(strategy string) (deviceNamer, error) {
|
func newDeviceNamer(strategy string) (deviceNamer, error) {
|
||||||
switch strategy {
|
switch strategy {
|
||||||
case deviceNameStrategyIndex:
|
case deviceNameStrategyIndex:
|
||||||
return deviceNameIndex{}, nil
|
return deviceNameIndex{}, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user