diff --git a/examples/embed-directive/embed-directive.go b/examples/embed-directive/embed-directive.go index 3cbbb0e..2350138 100644 --- a/examples/embed-directive/embed-directive.go +++ b/examples/embed-directive/embed-directive.go @@ -14,16 +14,19 @@ import ( // `embed` directives accept paths relative to the directory containing the // Go source file. This directive embeds the contents of the file into the // `string` variable immediately following it. +// //go:embed folder/single_file.txt var fileString string // Or embed the contents of the file into a `[]byte`. +// //go:embed folder/single_file.txt var fileByte []byte // We can also embed multiple files or even folders with wildcards. This uses // a variable of the [embed.FS type](https://pkg.go.dev/embed#FS), which // implements a simple virtual file system. +// //go:embed folder/single_file.txt //go:embed folder/*.hash var folder embed.FS diff --git a/examples/embed-directive/embed-directive.hash b/examples/embed-directive/embed-directive.hash index da30d5a..f81e317 100644 --- a/examples/embed-directive/embed-directive.hash +++ b/examples/embed-directive/embed-directive.hash @@ -1,2 +1,2 @@ -53a5e68182be7308ddb35cc209e6b905c5b9c713 -p6JB_5z1IBJ +69526bd78ac861c85bb12b96e9f1273e8aecc5a6 +6m2ll-D52BB diff --git a/public/embed-directive b/public/embed-directive index 7b41780..906bece 100644 --- a/public/embed-directive +++ b/public/embed-directive @@ -35,7 +35,7 @@ build time. Read more about the embed directive
package maindiff --git a/tools/generate.go b/tools/generate.go index f8341c6..9362c74 100644 --- a/tools/generate.go +++ b/tools/generate.go @@ -95,8 +95,8 @@ func debug(msg string) { } } -var docsPat = regexp.MustCompile("^\\s*(\\/\\/|#)\\s") -var dashPat = regexp.MustCompile("\\-+") +var docsPat = regexp.MustCompile(`^(\s*(\/\/|#)\s|\s*\/\/$)`) +var dashPat = regexp.MustCompile(`\-+`) // Seg is a segment of an example type Seg struct {