Skip to content

Commit c98fefe

Browse files
committed
Fix gofmt compability
Resolves: #106
1 parent 46bd79c commit c98fefe

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ install:
1414

1515
script:
1616
- go test -v -bench=. ./...
17+
- test -z $(gofmt -l ./example/statik/statik.go | tee /dev/stderr) || (echo 'Code not formatted correctly according to gofmt!' && exit 1)
18+

example/statik/statik.go

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

statik.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,25 +282,22 @@ import (
282282
283283
`, tags, comment, namePackage)
284284
if !fs.IsDefaultNamespace(assetNamespace) {
285-
fmt.Fprintf(&qb, `
286-
const %s = "%s" // static asset namespace
285+
fmt.Fprintf(&qb, `const %s = "%s" // static asset namespace
287286
`, assetNamespaceIdentify, assetNamespace)
288287
}
289-
fmt.Fprint(&qb, `
290-
func init() {
288+
fmt.Fprint(&qb, `func init() {
291289
data := "`)
292290
FprintZipData(&qb, buffer.Bytes())
293291
if fs.IsDefaultNamespace(assetNamespace) {
294292
fmt.Fprint(&qb, `"
295-
fs.Register(data)
296-
}
297-
`)
298-
293+
fs.Register(data)
294+
}
295+
`)
299296
} else {
300297
fmt.Fprintf(&qb, `"
301-
fs.RegisterWithNamespace("%s", data)
302-
}
303-
`, assetNamespace)
298+
fs.RegisterWithNamespace("%s", data)
299+
}
300+
`, assetNamespace)
304301
}
305302

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

0 commit comments

Comments
 (0)