go-efuse/main.go

31 lines
542 B
Go

package main
import (
"embed"
"log"
)
//go:embed files/*
var content embed.FS
func main() {
gfw, err := NewGFW(GFWConfig{
EmbedFS: content,
DefaultExecutable: "test.sh",
})
if err != nil {
log.Fatalf("Unable to create GFW: %v", err)
}
if err := gfw.Mount(); err != nil {
log.Fatalf("Unable to mount GFW:, %v", err)
}
defer func() {
if err := gfw.Unmount(); err != nil {
log.Printf("Failed to unmount: %v", err)
}
}()
if err := gfw.Execute(); err != nil {
log.Printf("Failed to execute: %v", err)
}
}