have you looked into standard library template documentation?
From the documentation it seems possible to create a layout:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{{.Title}}</title>
</head>
<body>
{{ template "content" . }}
</body>
</html>
Example (home.html):
{{ define "content" }}
<h2>Welcome to the Home Page</h2>
<p>This is the home page content.</p>
{{ end }}
tmpl := template.Must(template.ParseFiles("layout.html", "home.html"))
// Data to be passed to the template
data := struct {
Title string
}{
Title: "Home Page",
}
This could be returned by your http response.