Skip to content

Commit

Permalink
tests(notebook-controller): fix unintended shadowing of cfg variable
Browse files Browse the repository at this point in the history
This is a nasty Go gotcha, and we aren't the first to have trouble with it
https://temporal.io/blog/go-shadowing-bad-choices#the-bug

Signed-off-by: Jiri Daněk <jdanek@redhat.com>
  • Loading branch information
jiridanek committed Nov 24, 2024
1 parent 4275d99 commit b28ebd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/notebook-controller/controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ var _ = BeforeSuite(func() {
ErrorIfCRDPathMissing: true,
}

cfg, err := testEnv.Start()
var err error
cfg, err = testEnv.Start()
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())

Expand Down

0 comments on commit b28ebd4

Please sign in to comment.