aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorGravatar Luciano Nooijen <luciano@bytecode.nl> 2021-09-11 00:57:07 +0200
committerGravatar GitHub <noreply@github.com> 2021-09-10 15:57:07 -0700
commitdd62ebd406a23184ec072d38894a5a3aac141b0d (patch)
tree7a0de51f9c0439b20a837410ae054ed0c2da34af /handler.go
parent68f125ff5e3042610be114899531d73137726027 (diff)
downloadsally-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.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/handler.go b/handler.go
index a29f399..b10b8f5 100644
--- a/handler.go
+++ b/handler.go
@@ -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