Merge pull request #90 from tamird/generated-by

Insert "generated by" comments
This commit is contained in:
Jim Teeuwen 2015-05-28 13:39:15 +02:00
commit 69db088dee
6 changed files with 59 additions and 2 deletions

View File

@ -49,10 +49,32 @@ func Translate(c *Config) error {
bfd := bufio.NewWriter(fd) bfd := bufio.NewWriter(fd)
defer bfd.Flush() defer bfd.Flush()
// Write the header. This makes e.g. Github ignore diffs in generated files.
if _, err = fmt.Fprint(bfd, "// Code generated by go-bindata.\n"); err != nil {
return err
}
if _, err = fmt.Fprint(bfd, "// sources:\n"); err != nil {
return err
}
wd, err := os.Getwd()
if err != nil {
return err
}
for _, asset := range toc {
relative, _ := filepath.Rel(wd, asset.Path)
if _, err = fmt.Fprintf(bfd, "// %s\n", relative); err != nil {
return err
}
}
if _, err = fmt.Fprint(bfd, "// DO NOT EDIT!\n"); err != nil {
return err
}
// Write build tags, if applicable. // Write build tags, if applicable.
if len(c.Tags) > 0 { if len(c.Tags) > 0 {
_, err = fmt.Fprintf(bfd, "// +build %s\n\n", c.Tags) if _, err = fmt.Fprintf(bfd, "// +build %s\n\n", c.Tags); err != nil {
if err != nil {
return err return err
} }
} }

View File

@ -1,3 +1,10 @@
// Code generated by go-bindata.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
// DO NOT EDIT!
package main package main
import ( import (

View File

@ -1,3 +1,10 @@
// Code generated by go-bindata.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
// DO NOT EDIT!
package main package main
import ( import (

View File

@ -1,3 +1,10 @@
// Code generated by go-bindata.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
// DO NOT EDIT!
package main package main
import ( import (

View File

@ -1,3 +1,10 @@
// Code generated by go-bindata.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
// DO NOT EDIT!
package main package main
import ( import (

View File

@ -1,3 +1,10 @@
// Code generated by go-bindata.
// sources:
// in/a/test.asset
// in/b/test.asset
// in/c/test.asset
// in/test.asset
// DO NOT EDIT!
package main package main
import ( import (