9 changed files with 70 additions and 15 deletions
@ -0,0 +1,22 @@
|
||||
// +build devel
|
||||
|
||||
/* |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
*/ |
||||
|
||||
package gui |
||||
|
||||
import ( |
||||
"net/http" |
||||
"os" |
||||
) |
||||
|
||||
func getStaticFS() (http.FileSystem, error) { |
||||
return http.FS(os.DirFS("static")), nil |
||||
} |
||||
|
||||
/* |
||||
######################################################################################################## @(°_°)@ ####### |
||||
*/ |
@ -0,0 +1,31 @@
|
||||
// +build !devel
|
||||
|
||||
/* |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
||||
------------------------------------------------------------------------------------------------------------------------ |
||||
*/ |
||||
|
||||
package gui |
||||
|
||||
import ( |
||||
"embed" |
||||
"io/fs" |
||||
"net/http" |
||||
) |
||||
|
||||
//go:embed static
|
||||
var static embed.FS |
||||
|
||||
func getStaticFS() (http.FileSystem, error) { |
||||
fsys, err := fs.Sub(static, "static") |
||||
if err != nil { |
||||
return nil, err |
||||
} |
||||
|
||||
return http.FS(fsys), nil |
||||
} |
||||
|
||||
/* |
||||
######################################################################################################## @(°_°)@ ####### |
||||
*/ |
Loading…
Reference in new issue