From 53f2e2b0feb369b9bb36726ad856adb4e7ba12d0 Mon Sep 17 00:00:00 2001 From: Will McCutchen <will@mccutch.org> Date: Mon, 29 May 2017 21:19:47 -0700 Subject: [PATCH] Generate bindata from assets dir, not templates --- Makefile | 4 ++-- httpbin/{templates.go => assets.go} | 22 +++++++++---------- httpbin/{templates => assets}/forms-post.html | 0 httpbin/{templates => assets}/index.html | 0 httpbin/{templates => assets}/moby.html | 0 httpbin/{templates => assets}/utf8.html | 0 6 files changed, 13 insertions(+), 13 deletions(-) rename httpbin/{templates.go => assets.go} (99%) rename httpbin/{templates => assets}/forms-post.html (100%) rename httpbin/{templates => assets}/index.html (100%) rename httpbin/{templates => assets}/moby.html (100%) rename httpbin/{templates => assets}/utf8.html (100%) diff --git a/Makefile b/Makefile index 915687a..d524a4c 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ dist/go-httpbin: assets *.go httpbin/*.go mkdir -p dist go build -o dist/go-httpbin -assets: httpbin/templates/*.html - go-bindata -o httpbin/templates.go -pkg=httpbin -prefix=httpbin/templates httpbin/templates +assets: httpbin/assets/* + go-bindata -o httpbin/assets.go -pkg=httpbin -prefix=httpbin/assets httpbin/assets test: go test -v github.com/mccutchen/go-httpbin/httpbin diff --git a/httpbin/templates.go b/httpbin/assets.go similarity index 99% rename from httpbin/templates.go rename to httpbin/assets.go index 9d7a74e..e036ced 100644 --- a/httpbin/templates.go +++ b/httpbin/assets.go @@ -1,9 +1,9 @@ // Code generated by go-bindata. // sources: -// httpbin/templates/forms-post.html -// httpbin/templates/index.html -// httpbin/templates/moby.html -// httpbin/templates/utf8.html +// httpbin/assets/forms-post.html +// httpbin/assets/index.html +// httpbin/assets/moby.html +// httpbin/assets/utf8.html // DO NOT EDIT! package httpbin @@ -204,9 +204,9 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "forms-post.html": formsPostHtml, - "index.html": indexHtml, - "moby.html": mobyHtml, - "utf8.html": utf8Html, + "index.html": indexHtml, + "moby.html": mobyHtml, + "utf8.html": utf8Html, } // AssetDir returns the file names below a certain @@ -248,11 +248,12 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ "forms-post.html": &bintree{formsPostHtml, map[string]*bintree{}}, - "index.html": &bintree{indexHtml, map[string]*bintree{}}, - "moby.html": &bintree{mobyHtml, map[string]*bintree{}}, - "utf8.html": &bintree{utf8Html, map[string]*bintree{}}, + "index.html": &bintree{indexHtml, map[string]*bintree{}}, + "moby.html": &bintree{mobyHtml, map[string]*bintree{}}, + "utf8.html": &bintree{utf8Html, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory @@ -301,4 +302,3 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } - diff --git a/httpbin/templates/forms-post.html b/httpbin/assets/forms-post.html similarity index 100% rename from httpbin/templates/forms-post.html rename to httpbin/assets/forms-post.html diff --git a/httpbin/templates/index.html b/httpbin/assets/index.html similarity index 100% rename from httpbin/templates/index.html rename to httpbin/assets/index.html diff --git a/httpbin/templates/moby.html b/httpbin/assets/moby.html similarity index 100% rename from httpbin/templates/moby.html rename to httpbin/assets/moby.html diff --git a/httpbin/templates/utf8.html b/httpbin/assets/utf8.html similarity index 100% rename from httpbin/templates/utf8.html rename to httpbin/assets/utf8.html -- GitLab