Adjust for gofmt changes in 1.19

In 1.19, gofmt slightly changes how comments are formatted; a blank `//` is
inserted before `//go:embed` directives.

To accommodate for that in generate.go, treat empty comment lines as
part of docs segments.
This commit is contained in:
Eli Bendersky
2022-09-08 05:55:05 -07:00
parent 742fab3f1c
commit b4f289fe92
4 changed files with 8 additions and 5 deletions

View File

@@ -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

View File

@@ -1,2 +1,2 @@
53a5e68182be7308ddb35cc209e6b905c5b9c713
p6JB_5z1IBJ
69526bd78ac861c85bb12b96e9f1273e8aecc5a6
6m2ll-D52BB