|
61 | 61 | // The Go build system will recognize the directives and arrange for the declared variable
|
62 | 62 | // (in the example above, content) to be populated with the matching files from the file system.
|
63 | 63 | //
|
64 |
| -// The //go:embed directive accepts multiple space-separated patterns for brevity, |
65 |
| -// but it can also be repeated, to avoid very long lines when there are many patterns. |
66 |
| -// The patterns are interpreted relative to the package directory containing the source file. |
67 |
| -// The path separator is a forward slash, even on Windows systems. |
68 |
| -// To allow for naming files with spaces in their names, patterns can be written |
69 |
| -// as Go double-quoted or back-quoted string literals. |
| 64 | +// The //go:embed directive accepts multiple space-separated patterns for |
| 65 | +// brevity, but it can also be repeated, to avoid very long lines when there are |
| 66 | +// many patterns. The patterns are interpreted relative to the package directory |
| 67 | +// containing the source file. The path separator is a forward slash, even on |
| 68 | +// Windows systems. Patterns may not contain ‘.’ or ‘..’ or empty path elements, |
| 69 | +// nor may they begin or end with a slash. To match everything in the current |
| 70 | +// directory, use ‘*’ instead of ‘.’. To allow for naming files with spaces in |
| 71 | +// their names, patterns can be written as Go double-quoted or back-quoted |
| 72 | +// string literals. |
70 | 73 | //
|
71 | 74 | // If a pattern names a directory, all files in the subtree rooted at that directory are
|
72 | 75 | // embedded (recursively), except that files with names beginning with ‘.’ or ‘_’
|
|
87 | 90 | // Matches for empty directories are ignored. After that, each pattern in a //go:embed line
|
88 | 91 | // must match at least one file or non-empty directory.
|
89 | 92 | //
|
90 |
| -// Patterns must not contain ‘.’ or ‘..’ path elements nor begin with a leading slash. |
91 |
| -// To match everything in the current directory, use ‘*’ instead of ‘.’. |
92 |
| -// |
93 | 93 | // If any patterns are invalid or have invalid matches, the build will fail.
|
94 | 94 | //
|
95 | 95 | // Strings and Bytes
|
|
0 commit comments