From a9b5a89e111adbb798434776477f19f93f2ffac2 Mon Sep 17 00:00:00 2001 From: Linh Luong Date: Fri, 31 May 2024 00:56:16 +0700 Subject: [PATCH] issue 2117: fix another lint Signed-off-by: Linh Luong --- pkg/osutil/user.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/osutil/user.go b/pkg/osutil/user.go index 3cd605dcaa2c..7474296bca3e 100644 --- a/pkg/osutil/user.go +++ b/pkg/osutil/user.go @@ -35,8 +35,10 @@ var ( // regexUsername matches user and group names to be valid for `useradd`. // `useradd` allows names with a trailing '$', but it feels prudent to map those // names to the fallback user as well, so the regex does not allow them. -var regexUsername = regexp.MustCompile("^[a-z_][a-z0-9_-]*$") -var notAllowedUsernameRegex = regexp.MustCompile(`^admin$`) +var ( + regexUsername = regexp.MustCompile("^[a-z_][a-z0-9_-]*$") + notAllowedUsernameRegex = regexp.MustCompile(`^admin$`) +) // regexPath detects valid Linux path. var regexPath = regexp.MustCompile("^[/a-zA-Z0-9_-]+$")