Skip to content

Commit b2b1bb6

Browse files
furiosaclaude
andcommitted
docs: add inline comment explaining //go:embed directives (gt-e6e0q)
The embed directives are compile-time magic that may not be immediately clear to readers unfamiliar with Go's embed package. This comment explains how template files are bundled into the binary at compile time. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9b2a1c4 commit b2b1bb6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internal/templates/templates.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ import (
1010
"text/template"
1111
)
1212

13+
// The //go:embed directives below use Go's embed package to include template files
14+
// directly in the compiled binary. At compile time, the Go toolchain reads matching
15+
// files from disk and embeds their contents into the embed.FS variable. This allows
16+
// the templates to be distributed as a single binary without external file dependencies.
17+
// The glob patterns (e.g., "roles/*.md.tmpl") specify which files to embed.
18+
1319
//go:embed roles/*.md.tmpl messages/*.md.tmpl
1420
var templateFS embed.FS
1521

0 commit comments

Comments
 (0)