From 02a84fb6fb2a39bfe7fc5cf6c0137bbf231b17fe Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 09 十一月 2023 14:14:17 +0800
Subject: [PATCH] 设备列表返回是否设置工艺参数字段

---
 service/plc.go |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/service/plc.go b/service/plc.go
index 1a48fa9..ac23286 100644
--- a/service/plc.go
+++ b/service/plc.go
@@ -45,7 +45,9 @@
 	var (
 		ipAddr string
 	)
-	defer dealErr(err)
+	defer func() {
+		dealErr(err)
+	}()
 	if plcConfig.Method == constvar.PlcMethodModbusTCP {
 		ipAddr = fmt.Sprintf("%s:%v", plcConfig.Address, plcConfig.Port)
 		err = WriteByModbusTCP(ipAddr, address, value)
@@ -81,7 +83,9 @@
 	var (
 		ipAddr string
 	)
-	defer dealErr(err)
+	defer func() {
+		dealErr(err)
+	}()
 	if plcConfig.Method == constvar.PlcMethodModbusTCP || plcConfig.Method == constvar.PlcMethodModbusRTU {
 		var value []byte
 		if plcConfig.Method == constvar.PlcMethodModbusTCP {

--
Gitblit v1.8.0