From 17800c65a072524222a6ec5987e7170c228584b2 Mon Sep 17 00:00:00 2001 From: Jim Teeuwen Date: Wed, 28 May 2014 14:43:02 +0200 Subject: [PATCH] Fixes formatting of various generated outputs to be more compatible with `go fmt`. This partially addresses issue #34 Signed-off-by: Jim Teeuwen --- debug.go | 4 ++-- release.go | 38 +++++++++++++++++++------------------- toc.go | 5 ++--- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/debug.go b/debug.go index 9abde60..5e69469 100644 --- a/debug.go +++ b/debug.go @@ -52,14 +52,14 @@ func bindata_read(path, name string) ([]byte, error) { // A debug entry is simply a function which reads the asset from // the original file (e.g.: from disk). func writeDebugAsset(w io.Writer, asset *Asset) error { - _, err := fmt.Fprintf(w, ` -// %s reads file data from disk. It returns an error on failure. + _, err := fmt.Fprintf(w, `// %s reads file data from disk. It returns an error on failure. func %s() ([]byte, error) { return bindata_read( %q, %q, ) } + `, asset.Func, asset.Func, asset.Path, asset.Name) return err } diff --git a/release.go b/release.go index f7e6e7c..0163fba 100644 --- a/release.go +++ b/release.go @@ -76,13 +76,13 @@ func writeReleaseAsset(w io.Writer, c *Config, asset *Asset) error { func header_compressed_nomemcopy(w io.Writer) error { _, err := fmt.Fprintf(w, `import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "reflect" - "strings" - "unsafe" + "bytes" + "compress/gzip" + "fmt" + "io" + "reflect" + "strings" + "unsafe" ) func bindata_read(data, name string) ([]byte, error) { @@ -116,11 +116,11 @@ func bindata_read(data, name string) ([]byte, error) { func header_compressed_memcopy(w io.Writer) error { _, err := fmt.Fprintf(w, `import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "strings" + "bytes" + "compress/gzip" + "fmt" + "io" + "strings" ) func bindata_read(data []byte, name string) ([]byte, error) { @@ -146,10 +146,10 @@ func bindata_read(data []byte, name string) ([]byte, error) { func header_uncompressed_nomemcopy(w io.Writer) error { _, err := fmt.Fprintf(w, `import ( - "fmt" - "reflect" - "strings" - "unsafe" + "fmt" + "reflect" + "strings" + "unsafe" ) func bindata_read(data, name string) ([]byte, error) { @@ -169,8 +169,8 @@ func bindata_read(data, name string) ([]byte, error) { func header_uncompressed_memcopy(w io.Writer) error { _, err := fmt.Fprintf(w, `import ( - "fmt" - "strings" + "fmt" + "strings" ) `) return err @@ -220,7 +220,7 @@ func compressed_memcopy(w io.Writer, asset *Asset, r io.Reader) error { } _, err = fmt.Fprintf(w, ` - }, + }, %q, ) } diff --git a/toc.go b/toc.go index b99bb88..ead6379 100644 --- a/toc.go +++ b/toc.go @@ -28,8 +28,7 @@ func writeTOC(w io.Writer, toc []Asset) error { // writeTOCHeader writes the table of contents file header. func writeTOCHeader(w io.Writer) error { - _, err := fmt.Fprintf(w, ` -// Asset loads and returns the asset for the given name. + _, err := fmt.Fprintf(w, `// Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { @@ -50,7 +49,7 @@ func AssetNames() []string { } // _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string] func() ([]byte, error) { +var _bindata = map[string]func() ([]byte, error){ `) return err }