Skip to content

Commit 36bf233

Browse files
committed
label: don't capitalize error strings
This fixes the following linter warnings: > go-selinux/label/label_linux.go:21:28: ST1005: error strings should not be capitalized (staticcheck) > var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be used together") > ^ > go-selinux/label/label_linux.go:55:20: ST1005: error strings should not be capitalized (staticcheck) > return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt) > ^ > go-selinux/label/label_linux.go:59:20: ST1005: error strings should not be capitalized (staticcheck) > return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0]) > ^ Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 996c4cf commit 36bf233

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

go-selinux/label/label_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var validOptions = map[string]bool{
1818
"level": true,
1919
}
2020

21-
var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be used together")
21+
var ErrIncompatibleLabel = errors.New("bad SELinux option: z and Z can not be used together")
2222

2323
// InitLabels returns the process label and file labels to be used within
2424
// the container. A list of options can be passed into this function to alter
@@ -52,11 +52,11 @@ func InitLabels(options []string) (plabel string, mlabel string, retErr error) {
5252
return "", selinux.PrivContainerMountLabel(), nil
5353
}
5454
if i := strings.Index(opt, ":"); i == -1 {
55-
return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt)
55+
return "", "", fmt.Errorf("bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt)
5656
}
5757
con := strings.SplitN(opt, ":", 2)
5858
if !validOptions[con[0]] {
59-
return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0])
59+
return "", "", fmt.Errorf("bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0])
6060
}
6161
if con[0] == "filetype" {
6262
mcon["type"] = con[1]

0 commit comments

Comments
 (0)