You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2021/05/03 11:43:36 UTC

[plc4x] 01/04: plc4go: small cleanup

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 8271aa451f84ea5d0ac4a7ce801c0b026fefaa37
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon May 3 11:04:58 2021 +0200

    plc4go: small cleanup
---
 plc4go/internal/plc4go/ads/readwrite/model/AdsStaticHelper.go | 6 +-----
 plc4go/internal/plc4go/s7/readwrite/model/S7StaticHelper.go   | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/plc4go/internal/plc4go/ads/readwrite/model/AdsStaticHelper.go b/plc4go/internal/plc4go/ads/readwrite/model/AdsStaticHelper.go
index 99a28c0..4a71694 100644
--- a/plc4go/internal/plc4go/ads/readwrite/model/AdsStaticHelper.go
+++ b/plc4go/internal/plc4go/ads/readwrite/model/AdsStaticHelper.go
@@ -32,11 +32,7 @@ func StaticHelperParseAmsString(io utils.ReadBuffer, stringLength int32, encodin
 	case "UTF-16":
 		multiplier = 16
 	}
-	readString, err := io.ReadString("", uint32(stringLength*multiplier))
-	if err != nil {
-		return "", err
-	}
-	return readString, nil
+	return io.ReadString("", uint32(stringLength*multiplier))
 }
 
 func StaticHelperSerializeAmsString(io utils.WriteBuffer, value values.PlcValue, stringLength int32, encoding string) error {
diff --git a/plc4go/internal/plc4go/s7/readwrite/model/S7StaticHelper.go b/plc4go/internal/plc4go/s7/readwrite/model/S7StaticHelper.go
index 580d6f3..2b72fe9 100644
--- a/plc4go/internal/plc4go/s7/readwrite/model/S7StaticHelper.go
+++ b/plc4go/internal/plc4go/s7/readwrite/model/S7StaticHelper.go
@@ -130,11 +130,7 @@ func StaticHelperParseS7String(io utils.ReadBuffer, stringLength int32, encoding
 	case "UTF-16":
 		multiplier = 16
 	}
-	readString, err := io.ReadString("", uint32(stringLength*multiplier))
-	if err != nil {
-		return "", err
-	}
-	return readString, nil
+	return io.ReadString("", uint32(stringLength*multiplier))
 }
 
 func StaticHelperSerializeS7String(io utils.WriteBuffer, value values.PlcValue, stringLength int32, encoding string) error {