revid/config/config.go: Made string a const, removed redundant == true

This commit is contained in:
Scott 2020-01-02 15:13:39 +10:30
parent 442ad27e98
commit 1f8ef44216
1 changed files with 5 additions and 2 deletions

View File

@ -118,6 +118,9 @@ const (
FilterKNN
)
// OS names
const raspian = "Raspbian GNU/Linux"
// Config provides parameters relevant to a revid instance. A new config must
// be passed to the constructor. Default values for these fields are defined
// as consts above.
@ -449,12 +452,12 @@ func (c *Config) Validate() error {
c.PSITime = defaultPSITime
}
if c.ShowWindows == true {
if c.ShowWindows {
os, err := osName()
if err != nil {
return err
}
if os == "Raspbian GNU/Linux" {
if os == raspian {
c.Logger.Log(logger.Info, "ShowWindows disabled on Raspbian GNU/Linux")
c.ShowWindows = false
}