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

feat: return zero value in getter methods if receiver is nil #359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WingT
Copy link

@WingT WingT commented Oct 21, 2024

Add nil check in go structs' getter methods, making chained function call like a.GetB().GetC().GetD() won't panic.

I have:

  • Written a clear PR title and description (above)
  • Signed the Khan Academy CLA
  • Added tests covering my changes, if applicable
  • Included a link to the issue fixed, if applicable
  • Included documentation, for new features
  • Added an entry to the changelog

Change-Id: If1c1c5f305cae0abda2f80b8c3e3c1ec37a3d8dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant