cleanup: resolves gocritic linter issues

This commit resolves gocritic linter errors.

Updates: #2250

Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
Yati Padia 2021-07-07 17:11:23 +05:30 committed by mergify[bot]
parent dd0884310f
commit ffab37f44f
3 changed files with 3 additions and 3 deletions

View File

@ -621,7 +621,7 @@ var _ = Describe("RBD", func() {
// Prepare the rbd-nbd with command args
attachCmd := strings.ReplaceAll(mapCmd, "map", "attach --device /dev/nbd0")
m1 := regexp.MustCompile(`/keyfile-[0-9]* `)
m1 := regexp.MustCompile(`/keyfile-\d* `)
attachCmd = m1.ReplaceAllString(attachCmd, "/keyfile-test ")
e2elog.Logf("attach command to run after restart, attachCmd: %v", attachCmd)

View File

@ -575,7 +575,7 @@ func (ns *NodeServer) createTargetMountPath(ctx context.Context, mountPath strin
// Check if that mount path exists properly
notMnt, err := mount.IsNotMountPoint(ns.mounter, mountPath)
if err == nil {
return notMnt, err
return notMnt, nil
}
if !os.IsNotExist(err) {
return false, status.Error(codes.Internal, err.Error())

View File

@ -165,7 +165,7 @@ func getSchedulingDetails(parameters map[string]string) (admin.Interval, admin.S
// validateSchedulingInterval return the interval as it is if its ending with
// `m|h|d` or else it will return error.
func validateSchedulingInterval(interval string) (admin.Interval, error) {
var re = regexp.MustCompile(`^[0-9]+[mhd]$`)
var re = regexp.MustCompile(`^\d+[mhd]$`)
if re.MatchString(interval) {
return admin.Interval(interval), nil
}