From b31af52d41f62806e857bc196b7481b2b66be1b3 Mon Sep 17 00:00:00 2001 From: FleetingOrchard <55274008+FleetingOrchard@users.noreply.github.com> Date: Sun, 29 Dec 2019 04:53:16 +1100 Subject: [PATCH] Fix usage of Box.Bytes causing depreciation message (#295) * Add release make target * Use Box.Find now that Box.Bytes is depreciated Pretty much directly mocked off of the post-depreciation implementation of Box.Bytes in packr. In theory we should totally be checking the returned error but I'm lazy. --- Makefile | 2 ++ pkg/api/server.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dd9f8336d..a0194001a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ ifeq ($(OS),Windows_NT) SET := set endif +release: generate ui build + build: $(eval DATE := $(shell go run scripts/getDate.go)) $(eval GITHASH := $(shell git rev-parse --short HEAD)) diff --git a/pkg/api/server.go b/pkg/api/server.go index 49abbe158..c7d0e98f5 100644 --- a/pkg/api/server.go +++ b/pkg/api/server.go @@ -129,7 +129,7 @@ func Start() { r.HandleFunc("/setup*", func(w http.ResponseWriter, r *http.Request) { ext := path.Ext(r.URL.Path) if ext == ".html" || ext == "" { - data := setupUIBox.Bytes("index.html") + data, _ := setupUIBox.Find("index.html") _, _ = w.Write(data) } else { r.URL.Path = strings.Replace(r.URL.Path, "/setup", "", 1) @@ -193,7 +193,7 @@ func Start() { r.HandleFunc("/*", func(w http.ResponseWriter, r *http.Request) { ext := path.Ext(r.URL.Path) if ext == ".html" || ext == "" { - data := uiBox.Bytes("index.html") + data, _ := uiBox.Find("index.html") _, _ = w.Write(data) } else { http.FileServer(uiBox).ServeHTTP(w, r)