Skip to content

Commit

Permalink
Fix gofmt compability
Browse files Browse the repository at this point in the history
Resolves: rakyll#106
  • Loading branch information
Jonas Falck committed Feb 27, 2020
1 parent 46bd79c commit b6d7024
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions statik.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,19 @@ import (
const %s = "%s" // static asset namespace
`, assetNamespaceIdentify, assetNamespace)
}
fmt.Fprint(&qb, `
func init() {
fmt.Fprint(&qb, `func init() {
data := "`)
FprintZipData(&qb, buffer.Bytes())
if fs.IsDefaultNamespace(assetNamespace) {
fmt.Fprint(&qb, `"
fs.Register(data)
}
`)

fs.Register(data)
}
`)
} else {
fmt.Fprintf(&qb, `"
fs.RegisterWithNamespace("%s", data)
}
`, assetNamespace)
fs.RegisterWithNamespace("%s", data)
}
`, assetNamespace)
}

if err = ioutil.WriteFile(f.Name(), qb.Bytes(), 0644); err != nil {
Expand Down

0 comments on commit b6d7024

Please sign in to comment.