Skip to content

Commit

Permalink
Make generated code pass gofmt -s
Browse files Browse the repository at this point in the history
  • Loading branch information
lebauce authored and shuLhan committed Sep 9, 2017
1 parent accfe6a commit 89e7c37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}
`)
return err
}
6 changes: 5 additions & 1 deletion toc.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func (root *assetTree) funcOrNil() string {
}

func (root *assetTree) writeGoMap(w io.Writer, nident int) {
fmt.Fprintf(w, "&bintree{%s, map[string]*bintree{", root.funcOrNil())
if nident == 0 {
io.WriteString(w, "&bintree")
}
fmt.Fprintf(w, "{%s, map[string]*bintree{", root.funcOrNil())

if len(root.Children) > 0 {
io.WriteString(w, "\n")
Expand Down Expand Up @@ -87,6 +90,7 @@ func (root *assetTree) WriteAsGoMap(w io.Writer) error {
Func func() (*asset, error)
Children map[string]*bintree
}
var _bintree = `)
root.writeGoMap(w, 0)
return err
Expand Down

0 comments on commit 89e7c37

Please sign in to comment.