Fixes formatting of various generated outputs to be

more compatible with `go fmt`. This partially addresses
issue #34

Signed-off-by: Jim Teeuwen <jimteeuwen@gmail.com>
pull/4/head
Jim Teeuwen 2014-05-28 14:43:02 +02:00
parent 394d5b27c0
commit 17800c65a0
3 changed files with 23 additions and 24 deletions

View File

@ -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
}

View File

@ -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,
)
}

5
toc.go
View File

@ -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
}