From 8f75b6aca49b3fa7c82aa71c3160a08efceff89e Mon Sep 17 00:00:00 2001 From: Adphi Date: Fri, 20 Jan 2023 14:33:52 +0100 Subject: [PATCH] react: use fs.FS instead of embed.FS Signed-off-by: Adphi --- react/ui.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/react/ui.go b/react/ui.go index 6d5a89c..51ce77e 100644 --- a/react/ui.go +++ b/react/ui.go @@ -15,7 +15,6 @@ package react import ( - "embed" "io/fs" "net/http" "net/http/httputil" @@ -28,14 +27,14 @@ const ( EndpointEnv = "REACT_ENDPOINT" ) -func NewHandler(dir embed.FS, subpath string) (http.Handler, error) { +func NewHandler(dir fs.FS, subpath string) (http.Handler, error) { if e := os.Getenv(EndpointEnv); e != "" { return newProxy(e) } return newStatic(dir, subpath) } -func newStatic(dir embed.FS, subpath string) (http.Handler, error) { +func newStatic(dir fs.FS, subpath string) (http.Handler, error) { s, err := fs.Sub(dir, subpath) if err != nil { return nil, err