Skip to content

Commit 8fa2f50

Browse files
authored
Merge pull request #5 from soyoo/patch-1
modbus-go: fix logical exceptions
2 parents 6967a72 + f4bf0d7 commit 8fa2f50

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/modbus/config.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ func (c *Config) parseFlags() error {
7777
pflag.StringVar(&c.Mqtt.PrivateKey, "mqtt-priviatekey", c.Mqtt.PrivateKey, "private key file path")
7878
pflag.Parse()
7979

80-
if (c.Mqtt.Cert != "" && c.Mqtt.PrivateKey == "") ||
81-
(c.Mqtt.Cert == "" && c.Mqtt.PrivateKey != "") {
80+
if c.Mqtt.Cert == "" || c.Mqtt.PrivateKey == "" {
8281
return ErrConfigCert
8382
}
8483
return nil

0 commit comments

Comments
 (0)