Add hello world example

This commit is contained in:
lash
2023-04-17 06:35:36 +01:00
parent 100f7f3b48
commit afb3ff3a36
11 changed files with 48 additions and 29 deletions

View File

@@ -0,0 +1 @@
world

1
examples/helloworld/root Normal file
View File

@@ -0,0 +1 @@
hello, {{.que}}!

View File

@@ -0,0 +1,2 @@
LOAD que 5
MAP que

View File

@@ -124,7 +124,8 @@ func main() {
}
ctx := context.Background()
en := engine.NewEngine(cfg, &st, rs, ca, ctx)
err := en.Init(ctx)
var err error
_, err = en.Init(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "engine init fail: %v\n", err)
os.Exit(1)

View File

@@ -72,7 +72,8 @@ func main() {
ctx := context.Background()
ctx = context.WithValue(ctx, "SessionId", sessionId)
en := engine.NewEngine(cfg, &st, rs, ca, ctx)
err := en.Init(ctx)
var err error
_, err = en.Init(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "engine init fail: %v\n", err)
os.Exit(1)