Replace go-bindata with go 1.16 embed (#452)

This commit is contained in:
Marcos Nils
2021-02-21 13:58:29 -03:00
committed by GitHub
parent cd6815aed5
commit 3a762ba15c
48 changed files with 21 additions and 576 deletions

View File

@@ -1,6 +1,7 @@
package handlers
import (
"io/fs"
"log"
"net/http"
"path/filepath"
@@ -33,9 +34,9 @@ func Home(w http.ResponseWriter, r *http.Request) {
return
}
index, err := Asset(filepath.Join(playground.AssetsDir, "/index.html"))
index, err := fs.ReadFile(staticFiles, filepath.Join(playground.AssetsDir, "/index.html"))
if err != nil {
index, err = Asset("default/index.html")
index, err = fs.ReadFile(staticFiles, "default/index.html")
}
if err != nil {