From e9c7970ea45271ba6add4068afb46b386e6702e3 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 2 Sep 2014 13:07:33 +0200 Subject: [PATCH] Only create assets map on demand --- auto/auto_test.go | 18 +++++++++- auto/gui.files.go | 82 +++++++++++++++++++++---------------------- cmd/genassets/main.go | 8 ++--- cmd/syncthing/gui.go | 4 ++- 4 files changed, 65 insertions(+), 47 deletions(-) diff --git a/auto/auto_test.go b/auto/auto_test.go index f612e340..0ff7d8df 100644 --- a/auto/auto_test.go +++ b/auto/auto_test.go @@ -4,4 +4,20 @@ package auto_test -// Empty test file to generate 0% coverage rather than no coverage +import ( + "bytes" + "testing" + + "github.com/syncthing/syncthing/auto" +) + +func TestAssets(t *testing.T) { + assets := auto.Assets() + idx, ok := assets["index.html"] + if !ok { + t.Fatal("No index.html in compiled in assets") + } + if !bytes.Contains(idx, []byte("