Merge pull request #90 from tamird/generated-by
Insert "generated by" comments
This commit is contained in:
commit
69db088dee
26
convert.go
26
convert.go
|
@ -49,10 +49,32 @@ func Translate(c *Config) error {
|
|||
bfd := bufio.NewWriter(fd)
|
||||
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.
|
||||
if len(c.Tags) > 0 {
|
||||
_, err = fmt.Fprintf(bfd, "// +build %s\n\n", c.Tags)
|
||||
if err != nil {
|
||||
if _, err = fmt.Fprintf(bfd, "// +build %s\n\n", c.Tags); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
7
testdata/out/compress-memcopy.go
vendored
7
testdata/out/compress-memcopy.go
vendored
|
@ -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
|
||||
|
||||
import (
|
||||
|
|
7
testdata/out/compress-nomemcopy.go
vendored
7
testdata/out/compress-nomemcopy.go
vendored
|
@ -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
|
||||
|
||||
import (
|
||||
|
|
7
testdata/out/debug.go
vendored
7
testdata/out/debug.go
vendored
|
@ -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
|
||||
|
||||
import (
|
||||
|
|
7
testdata/out/nocompress-memcopy.go
vendored
7
testdata/out/nocompress-memcopy.go
vendored
|
@ -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
|
||||
|
||||
import (
|
||||
|
|
7
testdata/out/nocompress-nomemcopy.go
vendored
7
testdata/out/nocompress-nomemcopy.go
vendored
|
@ -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
|
||||
|
||||
import (
|
||||
|
|
Loading…
Reference in New Issue
Block a user