fix: conditional client build
This commit is contained in:
@ -1,16 +1,24 @@
|
||||
// go:build !dev
|
||||
//go:build !dev
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed client
|
||||
//go:embed all:client
|
||||
var eclient embed.FS
|
||||
|
||||
func init() {
|
||||
fs := http.FS(eclient)
|
||||
log.Println("Initializing client for production")
|
||||
client, err := fs.Sub(eclient, "client")
|
||||
if err != nil {
|
||||
log.Fatalf("failed to get client: %v", err)
|
||||
}
|
||||
|
||||
fs := http.FS(client)
|
||||
embedfs = &fs
|
||||
}
|
||||
|
Reference in New Issue
Block a user