diff --git a/convert.go b/convert.go index 14bd24a..178c450 100644 --- a/convert.go +++ b/convert.go @@ -49,6 +49,29 @@ 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 { if _, err = fmt.Fprintf(bfd, "// +build %s\n\n", c.Tags); err != nil { diff --git a/testdata/out/compress-memcopy.go b/testdata/out/compress-memcopy.go index a0168d0..e99b31c 100644 --- a/testdata/out/compress-memcopy.go +++ b/testdata/out/compress-memcopy.go @@ -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 ( diff --git a/testdata/out/compress-nomemcopy.go b/testdata/out/compress-nomemcopy.go index 5ca481f..77f4dc4 100644 --- a/testdata/out/compress-nomemcopy.go +++ b/testdata/out/compress-nomemcopy.go @@ -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 ( diff --git a/testdata/out/debug.go b/testdata/out/debug.go index 5bfe7d9..f5426e4 100644 --- a/testdata/out/debug.go +++ b/testdata/out/debug.go @@ -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 ( diff --git a/testdata/out/nocompress-memcopy.go b/testdata/out/nocompress-memcopy.go index 73fcaef..95a4dba 100644 --- a/testdata/out/nocompress-memcopy.go +++ b/testdata/out/nocompress-memcopy.go @@ -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 ( diff --git a/testdata/out/nocompress-nomemcopy.go b/testdata/out/nocompress-nomemcopy.go index cb8e920..2b50e38 100644 --- a/testdata/out/nocompress-nomemcopy.go +++ b/testdata/out/nocompress-nomemcopy.go @@ -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 (