From f74216761a47a2a39089e902285f0c67830cb63d Mon Sep 17 00:00:00 2001 From: Victor Vrantchan Date: Mon, 16 Jan 2017 10:16:50 -0500 Subject: [PATCH] remove binaryFilesystem wrapper from bindata files (#964) --- server/service/frontend.go | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/server/service/frontend.go b/server/service/frontend.go index 1f21250b0..d5239c2b7 100644 --- a/server/service/frontend.go +++ b/server/service/frontend.go @@ -4,37 +4,16 @@ import ( "html/template" "io/ioutil" "net/http" - "strings" assetfs "github.com/elazarl/go-bindata-assetfs" ) -type binaryFileSystem struct { - fs *assetfs.AssetFS -} - -func (b *binaryFileSystem) Open(name string) (http.File, error) { - return b.fs.Open(name) -} - -func (b *binaryFileSystem) Exists(prefix string, filepath string) bool { - if p := strings.TrimPrefix(filepath, prefix); len(p) < len(filepath) { - if _, err := b.fs.Open(p); err != nil { - return false - } - return true - } - return false -} - -func newBinaryFileSystem(root string) *binaryFileSystem { - return &binaryFileSystem{ - fs: &assetfs.AssetFS{ - Asset: Asset, - AssetDir: AssetDir, - AssetInfo: AssetInfo, - Prefix: root, - }, +func newBinaryFileSystem(root string) *assetfs.AssetFS { + return &assetfs.AssetFS{ + Asset: Asset, + AssetDir: AssetDir, + AssetInfo: AssetInfo, + Prefix: root, } }