How can I do in Golang if I have an HTML file like this:
<html>
<head lang="en">
</head>
<body>
<header>{{.Header}}</header>
<div class="panel panel-default">
</div>
</body>
</html>
and I want to embed a part of code into to header tags from an other file like this:
<div id="logo"></div><div id="motto"></div>
My try:
header, _ := template.ParseFiles("header.html")
c := Content{Header: ""}
header.Execute(c.Header, nil)
index := template.Must(template.ParseFiles("index.html"))
index.Execute(w, c)