init
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// Package examples embeds the sample ship programs so the web site can offer
|
||||
// them in its editor.
|
||||
package examples
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
)
|
||||
|
||||
//go:embed programs/*.s
|
||||
var embedded embed.FS
|
||||
|
||||
// FS holds the programs, one file per program, at its root.
|
||||
var FS = mustSub()
|
||||
|
||||
func mustSub() fs.FS {
|
||||
sub, err := fs.Sub(embedded, "programs")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return sub
|
||||
}
|
||||
Reference in New Issue
Block a user