AX Principle 2: comments show HOW with real values, not WHAT the signature already says. Co-Authored-By: Charon <charon@lethean.io>
21 lines
375 B
Go
21 lines
375 B
Go
package mining
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed component/*
|
|
var componentFS embed.FS
|
|
|
|
// fs, err := mining.GetComponentFS()
|
|
// if err != nil { return err }
|
|
// router.StaticFS("/component", fs)
|
|
func GetComponentFS() (http.FileSystem, error) {
|
|
sub, err := fs.Sub(componentFS, "component")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return http.FS(sub), nil
|
|
}
|