package main import ( "encoding/json" "io/ioutil" "os" "text/template" ) func check(err error) { if err != nil { panic(err) } } func main() { var f interface{} b, err := ioutil.ReadAll(os.Stdin) check(err) check(json.Unmarshal(b, &f)) check(template.Must(template.ParseFiles(os.Args[1])).Execute(os.Stdout, f)) }