Skip to content

Commit ce62cfc

Browse files
authored
Merge pull request containerd#4612 from opjt/chore/lintwarning-resolve
fix: split else-if to avoid identical-branches lint error
2 parents 867c4b3 + ec16a4d commit ce62cfc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/cmd/container/create_userns_opts_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ func getUserAndGroup(spec string) (user.User, user.Group, error) {
324324
parts := strings.Split(spec, ":")
325325
if len(parts) > 2 {
326326
return user.User{}, user.Group{}, fmt.Errorf("invalid identity mapping format: %s", spec)
327-
} else if len(parts) == 2 && (parts[0] == "" || parts[1] == "") {
327+
}
328+
if len(parts) == 2 && (parts[0] == "" || parts[1] == "") {
328329
return user.User{}, user.Group{}, fmt.Errorf("invalid identity mapping format: %s", spec)
329330
}
330331

0 commit comments

Comments
 (0)