Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(notebook-controller): fix unintended shadowing of cfg variable #7664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tests(notebook-controller): fix unintended shadowing of cfg variable
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
commit b28ebd4b4b7350a5ad9a73c2ec8a5d79a442f6d1
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
Loading