Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

hardening DefaultContext to make it panic-free #2246

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

sio4
Copy link
Member

@sio4 sio4 commented Apr 21, 2022

Improved DefaultContext since it is exported and has some functions that could make a panic.

  • added comment for road-to-v1
  • made functions panic-free
    • DefaultContext.Set()
    • DefaultContext.Value()
    • DefaultContext.Data()
    • indirectly DefaultContext.String()
    • indirectly DefaultContext.MarshalJSON()
  • added unit tests for them

fixes #2241

@sio4 sio4 added the bug Something isn't working label Apr 21, 2022
@sio4 sio4 self-assigned this Apr 21, 2022
@sio4 sio4 requested a review from a team as a code owner April 21, 2022 14:54
@paganotoni paganotoni merged commit 2ccfb9f into gobuffalo:development Apr 21, 2022
@sio4 sio4 mentioned this pull request Apr 21, 2022
@sio4 sio4 deleted the panic-free-defaultcontext branch April 21, 2022 15:17
@sio4
Copy link
Member Author

sio4 commented Apr 21, 2022

Thank you for the lightning-fast approval and merging!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants