1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon/config: error strings should not be capitalized

daemon/config/config_unix.go:92:21: error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
            return fmt.Errorf("Default cgroup namespace mode (%v) is invalid. Use \"host\" or \"private\".", cm) // nolint: golint
                              ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 16ced7622b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-05-31 11:48:30 +02:00
parent fa6954cb98
commit 2fb7c9fea7
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -75,14 +75,14 @@ func (conf *Config) IsSwarmCompatible() error {
} }
func verifyDefaultIpcMode(mode string) error { func verifyDefaultIpcMode(mode string) error {
const hint = "Use \"shareable\" or \"private\"." const hint = `use "shareable" or "private"`
dm := containertypes.IpcMode(mode) dm := containertypes.IpcMode(mode)
if !dm.Valid() { if !dm.Valid() {
return fmt.Errorf("Default IPC mode setting (%v) is invalid. "+hint, dm) return fmt.Errorf("default IPC mode setting (%v) is invalid; "+hint, dm)
} }
if dm != "" && !dm.IsPrivate() && !dm.IsShareable() { if dm != "" && !dm.IsPrivate() && !dm.IsShareable() {
return fmt.Errorf("IPC mode \"%v\" is not supported as default value. "+hint, dm) return fmt.Errorf(`IPC mode "%v" is not supported as default value; `+hint, dm)
} }
return nil return nil
} }
@ -90,7 +90,7 @@ func verifyDefaultIpcMode(mode string) error {
func verifyDefaultCgroupNsMode(mode string) error { func verifyDefaultCgroupNsMode(mode string) error {
cm := containertypes.CgroupnsMode(mode) cm := containertypes.CgroupnsMode(mode)
if !cm.Valid() { if !cm.Valid() {
return fmt.Errorf("Default cgroup namespace mode (%v) is invalid. Use \"host\" or \"private\".", cm) //nolint: golint return fmt.Errorf(`default cgroup namespace mode (%v) is invalid; use "host" or "private"`, cm)
} }
return nil return nil