Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DirPerm is defined to write embed files. // Because embed file system is read-only. DirPerm = os.FileMode(0755) FilePerm = os.FileMode(0644) )
Functions ¶
func List ¶
List returns file list of embedded files.
Example ¶
list, err := embet.List(asset, "assets") if err != nil { log.Fatal(err) } for _, f := range list { fmt.Println(f) }
Output:
func WriteEmbedFiles ¶
WriteEmbedFiles write embed files to the real file system.
Example ¶
package main import ( "embed" "log" "os" "github.com/imishinist/embet" ) //go:embed assets/* var assets embed.FS func main() { dest := "dest" if err := os.Mkdir(dest, 0755); err != nil { log.Fatal(err) } if err := embet.WriteEmbedFiles(assets, "assets", dest); err != nil { log.Fatal(err) } }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.