Skip to content

Instantly share code, notes, and snippets.

@brk3
Created April 5, 2019 13:33
Show Gist options
  • Save brk3/20c7bcf7fb5a9e786ba15f086c831a50 to your computer and use it in GitHub Desktop.
Save brk3/20c7bcf7fb5a9e786ba15f086c831a50 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io/ioutil"
"go.starlark.net/starlark"
)
func main() {
data, err := ioutil.ReadFile("a")
if err != nil {
panic(err)
}
globals, _ := starlark.ExecFile(&starlark.Thread{}, "apparent/filename.star", string(data), starlark.StringDict{})
fmt.Println(len(globals["x"]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment