Mining/pkg/mining/component.go
Claude a433b37de1
Some checks failed
Security Scan / security (push) Waiting to run
Test / test (push) Has been cancelled
ax(mining): replace prose comment with usage example on GetComponentFS
AX Principle 2: comments show HOW with real values, not WHAT the
signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:07:18 +01:00

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
}