From 5a416bc99c9090b05e3271592676e27c188d55f9 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 7 Apr 2022 11:01:57 +0200 Subject: [PATCH] FIX: Use MountSpec* constants Signed-off-by: Evan Lezar --- internal/discover/csv/mount_spec.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/discover/csv/mount_spec.go b/internal/discover/csv/mount_spec.go index 44a453b8..3ab5f9bf 100644 --- a/internal/discover/csv/mount_spec.go +++ b/internal/discover/csv/mount_spec.go @@ -55,17 +55,18 @@ func NewMountSpecFromLine(line string) (*MountSpec, error) { // NewMountSpec creates a MountSpec with the specified type and path. An error is returned if the type is invalid. func NewMountSpec(mountType string, path string) (*MountSpec, error) { - switch mountType { - case "dev", "lib", "sym", "dir": + mt := MountSpecType(mountType) + switch mt { + case MountSpecDev, MountSpecLib, MountSpecSym, MountSpecDir: default: - return nil, fmt.Errorf("unexpected mount type: %v", mountType) + return nil, fmt.Errorf("unexpected mount type: %v", mt) } if path == "" { return nil, fmt.Errorf("invalid path: %v", path) } mount := MountSpec{ - Type: MountSpecType(mountType), + Type: mt, Path: path, }