Skip to content

Commit

Permalink
Remove usage of testing's Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
csueiras committed Feb 18, 2021
1 parent 0cfb2c0 commit 474eaf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ func loadInterface(t *testing.T, filesCode map[string]input) []*generator.FileCo
},
}
exported := packagestest.Export(t, packagestest.GOPATH, mods)
t.Cleanup(exported.Cleanup)
defer exported.Cleanup()

l := loader.NewLoader(func(cfg *packages.Config, patterns ...string) ([]*packages.Package, error) {
exported.Config.Mode = cfg.Mode
Expand Down
4 changes: 2 additions & 2 deletions internal/loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Service interface {
}
`,
}}})
t.Cleanup(exported.Cleanup)
defer exported.Cleanup()

l := loader.NewLoader(func(cfg *packages.Config, patterns ...string) ([]*packages.Package, error) {
exported.Config.Mode = cfg.Mode
Expand Down Expand Up @@ -60,7 +60,7 @@ type NotAnInterface struct {
}
`,
}}})
t.Cleanup(exported.Cleanup)
defer exported.Cleanup()

t.Run("RegEx", func(t *testing.T) {
l := loader.NewLoader(func(cfg *packages.Config, patterns ...string) ([]*packages.Package, error) {
Expand Down

0 comments on commit 474eaf8

Please sign in to comment.