Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
fix: support for errcheck linter (#219)
Browse files Browse the repository at this point in the history
* fix: support for errcheck linter

* fix: support for errcheck linter in legacy template
  • Loading branch information
pamburus authored and stanislas-m committed Aug 23, 2019
1 parent dc520c9 commit 012c9d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion builder/tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "github.com/gobuffalo/packr"
func init() {
{{- range $box := .Boxes }}
{{- range .Files }}
packr.PackJSONBytes("{{$box.Name}}", "{{.Name}}", "{{.Contents}}")
_ = packr.PackJSONBytes("{{$box.Name}}", "{{.Name}}", "{{.Contents}}")
{{- end }}
{{- end }}
}
Expand Down
24 changes: 12 additions & 12 deletions v2/jam/store/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ var _ Store = &Legacy{}

type Legacy struct {
*Disk
boxes map[string][]legacyBox
boxes map[string][]legacyBox
}

func NewLegacy() *Legacy {
return &Legacy{
Disk: NewDisk("", ""),
boxes: map[string][]legacyBox{},
Disk: NewDisk("", ""),
boxes: map[string][]legacyBox{},
}
}

Expand All @@ -50,8 +50,8 @@ func (l *Legacy) Pack(box *parser.Box) error {

lbs := l.boxes[box.PackageDir]
lbs = append(lbs, legacyBox{
Box: box,
Files: fcs,
Box: box,
Files: fcs,
})
l.boxes[box.PackageDir] = lbs
return nil
Expand All @@ -78,8 +78,8 @@ func (l *Legacy) Close() error {
bx := b[0].Box
pkg := bx.Package
opts := map[string]interface{}{
"Package": pkg,
"Boxes": b,
"Package": pkg,
"Boxes": b,
}
p := filepath.Join(bx.PackageDir, "a_"+bx.Package+"-packr.go.tmpl")
tmpl, err := template.New(p).Parse(legacyTmpl)
Expand All @@ -102,13 +102,13 @@ func (l *Legacy) Close() error {
}

type legacyBox struct {
Box *parser.Box
Files []legacyFile
Box *parser.Box
Files []legacyFile
}

type legacyFile struct {
Name string
Contents string
Name string
Contents string
}

var legacyTmpl = `// Code generated by github.com/gobuffalo/packr. DO NOT EDIT.
Expand All @@ -122,7 +122,7 @@ import "github.com/gobuffalo/packr"
func init() {
{{- range $box := .Boxes }}
{{- range $box.Files }}
packr.PackJSONBytes("{{$box.Box.Name}}", "{{.Name}}", "{{.Contents}}")
_ = packr.PackJSONBytes("{{$box.Box.Name}}", "{{.Name}}", "{{.Contents}}")
{{- end }}
{{- end }}
}
Expand Down

0 comments on commit 012c9d5

Please sign in to comment.