go-jsonnet/examples/bazel/use_go_jsonnet.go
John Bartholomew fb07a24f45 feat: add an example bazel module + go binary using the library
This is mostly so that I can add it as the test module to be used
in the bazel registry presubmit
2025-03-16 16:10:31 +00:00

20 lines
297 B
Go

package main
import (
"fmt"
gjs "github.com/google/go-jsonnet"
)
func main() {
fmt.Printf("Example using go jsonnet (%s)\n", gjs.Version())
vm := gjs.MakeVM()
out, err := vm.EvaluateFile("example.jsonnet")
if err != nil {
fmt.Printf("%v\n", err)
} else {
fmt.Printf("%s", out)
}
}