Skip to content

Commit 7c661d7

Browse files
committed
Merge pull request #13 from Xe/master
Add note that template is auto-generated
2 parents 3808c9a + 743de68 commit 7c661d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

template.go

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"go/token"
1010
"io"
1111
"os"
12+
"time"
1213
)
1314

1415
// Template represents an entire Ego template.
@@ -226,6 +227,10 @@ func (p *Package) writeHeader(w io.Writer) error {
226227

227228
// Reset buffer.
228229
buf.Reset()
230+
231+
// Add note that the file is auto-generated
232+
fmt.Fprintf(&buf, "// Generated by ego on %s.\n// DO NOT EDIT\n\n", time.Now().Format(time.ANSIC))
233+
229234
fmt.Fprintf(&buf, "package %s\n", p.Name)
230235

231236
// Write deduped imports.

0 commit comments

Comments
 (0)