mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Add a comment about running "go generate".
This commit is contained in:
1 parent
6e7decbf3b
commit
3f79592b9a
2 files changed
+12
-1
No files matched your search
+10
-1
@@ -27,11 +27,20 @@ func main() {
|
||||
}
|
||||
|
||||
func main1() error {
|
||||
in, err := ioutil.ReadFile("preamble.h")
|
||||
const inFilename = "preamble.h"
|
||||
in, err := ioutil.ReadFile(inFilename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
const afterEditing = "// After editing this file,"
|
||||
if !bytes.HasPrefix(in, []byte(afterEditing)) {
|
||||
return fmt.Errorf("%s's contents do not start with %q", inFilename, afterEditing)
|
||||
}
|
||||
if i := bytes.Index(in, []byte("\n\n")); i >= 0 {
|
||||
in = in[i+2:]
|
||||
}
|
||||
|
||||
out := &bytes.Buffer{}
|
||||
out.WriteString("// Code generated by running \"go generate\". DO NOT EDIT.\n")
|
||||
out.WriteString("\n")
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// After editing this file, run "go generate" in this directory.
|
||||
|
||||
// Use of this source code is governed by a BSD-style license that can be found
|
||||
// in the LICENSE file.
|
||||
|
||||
|
||||
Reference in new issue
Block a user