Last active
October 28, 2017 08:27
-
-
Save kargirwar/6481cfa350f7ea57770270de8364fb8f to your computer and use it in GitHub Desktop.
Amber example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/eknkc/amber" | |
... | |
//path is the directory containing home.amber and header.amber | |
templates, err := amber.CompileDir(path, amber.DefaultDirOptions, amber.DefaultOptions) | |
//error handling | |
... | |
type temp struct { | |
Name string | |
} | |
func handler(w http.ResponseWriter, r *http.Request) { | |
..... | |
templates["home"].Execute(w, temp{Name: name}) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment