Skip to content

Commit

Permalink
add new warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
peakle committed Oct 24, 2021
1 parent 1fc2945 commit 582fba0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 1 addition & 8 deletions projects/packr/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (b *Builder) Run() error {
}

func (b *Builder) dump() error {
dumpPkg := func(p pkg) error {
for _, p := range b.pkgs {
name := filepath.Join(p.Dir, "a_"+p.Name+"-packr.go")
f, err := os.Create(name)
defer f.Close()
Expand All @@ -91,13 +91,6 @@ func (b *Builder) dump() error {
if err != nil {
return err
}
return nil
}

for _, p := range b.pkgs {
if err := dumpPkg(p); err != nil {
return err
}
}
return nil
}
Expand Down
1 change: 1 addition & 0 deletions projects/packr/output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ exit status 1
./builder/builder_test.go:38:12: ioutilDeprecated: ioutil.ReadFile is deprecated, use os.ReadFile instead
./builder/builder_test.go:63:13: ioutilDeprecated: ioutil.ReadFile is deprecated, use os.ReadFile instead
./builder/builder_test.go:68:12: ioutilDeprecated: ioutil.ReadFile is deprecated, use os.ReadFile instead
./builder/builder.go:81:3: deferInLoop: Possible resource leak, 'defer' is called in the 'for' loop

0 comments on commit 582fba0

Please sign in to comment.