INNER CODE UNIT · Go

compileFile

brexhq/substation · cmd/substation/main.go:124

func compileFile(fi string, extVars map[string]string) (string, error) {
	f, err := os.Open(fi)
	if err != nil {
		return "", err
	}
	defer f.Close()

	s, err := io.ReadAll(f)
	if err != nil {
		return "", err
	}

	return compileStr(string(s), extVars)
}

// compileStr returns JSON from a Jsonnet string.
func compileStr(s string, extVars map[string]string) (string, error) {
	vm := jsonnet.MakeVM()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…