go-efuse/main.go

31 lines
542 B
Go
Raw Normal View History

2024-07-03 04:33:12 -04:00
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)
}
2024-07-03 12:06:00 -04:00
defer func() {
if err := gfw.Unmount(); err != nil {
log.Printf("Failed to unmount: %v", err)
}
}()
2024-07-03 04:33:12 -04:00
if err := gfw.Execute(); err != nil {
2024-07-03 12:06:00 -04:00
log.Printf("Failed to execute: %v", err)
2024-07-03 04:33:12 -04:00
}
}