From 2edd39e0c3c1fb31e21ae0fa59e1039280e97767 Mon Sep 17 00:00:00 2001 From: skelly Date: Sun, 29 Jan 2023 22:43:17 -0800 Subject: [PATCH] Update objects.md (#401) --- docs/objects.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/objects.md b/docs/objects.md index 4b15060..99b4eb6 100644 --- a/docs/objects.md +++ b/docs/objects.md @@ -297,9 +297,11 @@ to add `StringArray` to the script: ```golang // script that uses 'my_list' s := tengo.NewScript([]byte(` - print(my_list + "three") + fmt := import("fmt") + fmt.println(my_list, ", three") `)) +s.SetImports(stdlib.GetModuleMap("fmt")) myList := &StringArray{Value: []string{"one", "two"}} s.Add("my_list", myList) // add StringArray value 'my_list' s.Run() // prints "one, two, three"