Skip to content

Commit

Permalink
Merge pull request #5 from soyoo/patch-1
Browse files Browse the repository at this point in the history
modbus-go: fix logical exceptions
  • Loading branch information
kubeedge-bot authored Feb 27, 2021
2 parents 6967a72 + f4bf0d7 commit 8fa2f50
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/modbus/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ func (c *Config) parseFlags() error {
pflag.StringVar(&c.Mqtt.PrivateKey, "mqtt-priviatekey", c.Mqtt.PrivateKey, "private key file path")
pflag.Parse()

if (c.Mqtt.Cert != "" && c.Mqtt.PrivateKey == "") ||
(c.Mqtt.Cert == "" && c.Mqtt.PrivateKey != "") {
if c.Mqtt.Cert == "" || c.Mqtt.PrivateKey == "" {
return ErrConfigCert
}
return nil
Expand Down

0 comments on commit 8fa2f50

Please sign in to comment.