Skip to content

Commit

Permalink
docs: fix usage snippet in README.md (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalg0wda authored Jan 16, 2025
1 parent d8b28cc commit de1e909
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ See the [documentation](https://pkg.go.dev/github.com/speakeasy-api/easytemplate
package main

import (
"context"
"fmt"
"log"
"os"
Expand All @@ -55,11 +56,13 @@ import (
)

func main() {
// Create a new easytemplate engine.
// Create and initialize a new easytemplate engine.
engine := easytemplate.New()
ctx := context.Background()
data := 0
engine.Init(ctx, data)
// Start the engine from a javascript entrypoint.
err := engine.RunScript("main.js", data)
err := engine.RunScript(ctx, "main.js")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit de1e909

Please sign in to comment.