From 7fcba33b9700f983856e1b259c204adec25a732a Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 25 Apr 2022 14:14:58 +0800 Subject: [PATCH] feat: add builtin function environ/ENV --- docs/CHANGELOG.md | 7 +++++++ hrp/internal/builtin/function.go | 3 +++ 2 files changed, 10 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d6f3369e..54067d1d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## v4.0.0-beta2 (2022-04-25) + +**go version** + +- feat: add builtin function `environ`/`ENV` +- fix: demo function compatibility + ## v4.0.0-beta (2022-04-24) - refactor: merge [hrp] into httprunner v4, which will include golang and python dual engine diff --git a/hrp/internal/builtin/function.go b/hrp/internal/builtin/function.go index dd1fca1b..7be081dc 100644 --- a/hrp/internal/builtin/function.go +++ b/hrp/internal/builtin/function.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "math" "math/rand" + "os" "time" ) @@ -16,6 +17,8 @@ var Functions = map[string]interface{}{ "md5": MD5, // call with one argument "parameterize": loadFromCSV, "P": loadFromCSV, + "environ": os.Getenv, + "ENV": os.Getenv, "load_ws_message": loadMessage, }