Update Go dependencies and minimal Go version to 1.20 (#1650)

Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lauris BH
2023-03-21 01:48:15 +02:00
committed by GitHub
parent 60733c5cb9
commit 46452fbd84
29 changed files with 251 additions and 224 deletions

View File

@@ -10,17 +10,20 @@ import (
//go:embed dist/*
var webFiles embed.FS
func HTTPFS() http.FileSystem {
func HTTPFS() (http.FileSystem, error) {
httpFS, err := fs.Sub(webFiles, "dist")
if err != nil {
panic(err)
return nil, err
}
return http.FS(httpFS)
return http.FS(httpFS), nil
}
func Lookup(path string) (buf []byte, err error) {
file, err := HTTPFS().Open(path)
httpFS, err := HTTPFS()
if err != nil {
return nil, err
}
file, err := httpFS.Open(path)
if err != nil {
return nil, err
}
@@ -33,12 +36,3 @@ func Lookup(path string) (buf []byte, err error) {
return buf, nil
}
func MustLookup(path string) (buf []byte) {
buf, err := Lookup(path)
if err != nil {
panic(err)
}
return buf
}