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 2023/06/20 08:02:27 UTC

[plc4x] branch develop updated: fix(plc4go/spi): use LookupEnv instead of GetEnv in test utils

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


The following commit(s) were added to refs/heads/develop by this push:
     new 31a8aa51c3 fix(plc4go/spi): use LookupEnv instead of GetEnv in test utils
31a8aa51c3 is described below

commit 31a8aa51c3691dfe4eed69fceab6ed12fbe11356
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Jun 20 10:02:21 2023 +0200

    fix(plc4go/spi): use LookupEnv instead of GetEnv in test utils
---
 plc4go/spi/testutils/TestUtils.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plc4go/spi/testutils/TestUtils.go b/plc4go/spi/testutils/TestUtils.go
index 71f3d68b6c..492339df42 100644
--- a/plc4go/spi/testutils/TestUtils.go
+++ b/plc4go/spi/testutils/TestUtils.go
@@ -144,13 +144,13 @@ func init() {
 }
 
 func getOrLeaveBool(key string, setting *bool) {
-	if env := os.Getenv(key); env != "" {
+	if env, ok := os.LookupEnv(key); ok {
 		*setting = strings.EqualFold(env, "true")
 	}
 }
 
 func getOrLeaveDuration(key string, setting *time.Duration) {
-	if env := os.Getenv(key); env != "" {
+	if env, ok := os.LookupEnv(key); ok {
 		parsedDuration, err := strconv.ParseInt(env, 10, 64)
 		if err != nil {
 			panic(err)