mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-12 17:50:07 +00:00
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:
22
web/web.go
22
web/web.go
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user