diff options
author | 2021-09-11 00:57:07 +0200 | |
---|---|---|
committer | 2021-09-10 15:57:07 -0700 | |
commit | dd62ebd406a23184ec072d38894a5a3aac141b0d (patch) | |
tree | 7a0de51f9c0439b20a837410ae054ed0c2da34af /handler.go | |
parent | 68f125ff5e3042610be114899531d73137726027 (diff) | |
download | sally-dd62ebd406a23184ec072d38894a5a3aac141b0d.tar.gz sally-dd62ebd406a23184ec072d38894a5a3aac141b0d.tar.zst sally-dd62ebd406a23184ec072d38894a5a3aac141b0d.zip |
Use go embed for templates (#50)
Go 1.16 includes a `//go:embed` directive that obviates the need for
bindata. Use `//go:embed` instead of bindata for templates used in
sally.
Signed-off-by: Luciano Nooijen <luciano@bytecode.nl>
Co-authored-by: Abhinav Gupta <abg@uber.com>
Diffstat (limited to 'handler.go')
-rw-r--r-- | handler.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -6,13 +6,14 @@ import ( "net/http" "github.com/julienschmidt/httprouter" + "go.uber.org/sally/templates" ) var ( indexTemplate = template.Must( - template.New("index.html").Parse(string(MustAsset("templates/index.html")))) + template.New("index.html").Parse(templates.Index)) packageTemplate = template.Must( - template.New("package.html").Parse(string(MustAsset("templates/package.html")))) + template.New("package.html").Parse(templates.Package)) ) // CreateHandler creates a Sally http.Handler |