Skip to content

Instantly share code, notes, and snippets.

@jlindsey
Created October 26, 2018 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlindsey/fceb0b682fc8d63129cb6129c0d17da5 to your computer and use it in GitHub Desktop.
Save jlindsey/fceb0b682fc8d63129cb6129c0d17da5 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<body>
<h1>Body</h1>
{{template "test"}}
</body>
</html>
package main
import (
"os"
"html/template"
)
func main() {
tmpl := template.Must(template.ParseFiles("./arts.html", "./test.html"))
tmpl.Execute(os.Stdout, nil)
}
<!doctype html>
<html>
<body>
<h1>Body</h1>
<h1>Hello, test!</h1>
</body>
</html>
{{define "test"}}
<h1>Hello, test!</h1>
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment