New concept exercise: panic/recover
Related: #1373
First iteration for Exercise Concept for Panic Recover
- pani_recover.go
- panic_recover_test.go
Upcoming iteration-
- Add more methods to panic_recover.go
- Add more test cases to panic_recover_test.go
- Add .meta folder including config, exemplar, design files
- Add .docs folder
Dear myworkcircle
Thank you for contributing to the Go track on Exercism! π You will see some automated feedback below π€. It would be great if you can make sure your PR covers those points. This will save your reviewer some time and your change can be merged quicker.
-
π The following files usually contain very similar content.
-
concepts/<concept>/about.md -
concepts/<concept>/introduction.md -
exercises/concept/<exercise>/.docs/introduction.md
Please check whether the changes you made to one of these also need to be applied to the others.
-
-
𧦠If you changed the function signature or the function comment in the exemplar file or the stub file (
<exercise>.go), make sure the change is applied to both files. -
π If your PR fully fixes an issue, please include the text
Fixes #issue_noin any line of the PR description. This will make the issue be automatically be closed when the PR is merged. If your PR is related to an existing issue but does not fix it completely, please link the issue anywhere in the description of the PR with#issue_no. You can read more about this in Github: Linking a pull request to an issue -
βοΈ If your PR is not related to an existing issue (and is not self-explaining like a typo fix), please make sure the description explains why the change you made is necessary.
-
π€ If your PR fixes an easy to identify typo, if would be great if you could check for that typo in the whole repo. For example, if you found
Unicdoe, use "replace all" in your editor (or command line magic) to fix it consistently.
Dear Reviewer/Maintainer
-
π Make sure you set the appropriate
x:sizelabel for the PR. (This also works after merging, in case you forgot about it.) -
π Don't be too nit-picky. If the PR is a clear improvement compared to the status quo, it should be approved as clear signal this is good to be merged even if the minor comments you might have are not addressed by the contributor. Further improvement ideas can be captured in issues (if important enough) and implemented via additional PRs.
-
π€ After reviewing the diff in the "Files changed" section, take a moment to think about whether there are changes missing from the diff. Does something need to be adjusted in other places so the code or content stays consistent?
Automated comment created by PR Commenter π€.
Not able to pass github tests for PR can you helpo please @junedev . It says methods not found but i have declared methods in other files
I can't see that error specifically, only this one:
Error: tmp/lint/concept/panic_recover/panic_recover_test.go:43:2: undeclared name: `fmt` (typecheck)
fmt.Println(val)
^
Error: tmp/lint/concept/panic_recover/panic_recover_test.go:41:3: val declared but not used (typecheck)
val := CreatePanic(tt.name, len(tt.name))
^
I think you tried to solve the "val declared but not used" with the print, but you are not importing fmt in the tests.
Just to give you a bit more context: the script we have in CI copies the .meta/exemplar.go to a folder with the tests you provide and runs the tests against the exemplar. So, for local development you probably want to keep editing panic_recover.go and implement the solution there, just so you have the tests in the same folder of the solution. When you want to run that solution here in CI copy your implemented solution from panic_recover.go to .meta/exemplar.go and push. When you feel you have the code for the exemplar completely ready and you won't do any more code changes, you can replace the code in panic_recover.go to have the stub and leave the solution in the exemplar.
Also, instead of go/exercises/concept/panic-recover we tend to have simpler module/package names for the exercises. The module/package can just be called something like panicrecover in this case.
I can't see that error specifically, only this one:
Error: tmp/lint/concept/panic_recover/panic_recover_test.go:43:2: undeclared name: `fmt` (typecheck) fmt.Println(val) ^ Error: tmp/lint/concept/panic_recover/panic_recover_test.go:41:3: val declared but not used (typecheck) val := CreatePanic(tt.name, len(tt.name)) ^I think you tried to solve the "val declared but not used" with the print, but you are not importing
fmtin the tests.Just to give you a bit more context: the script we have in CI copies the
.meta/exemplar.goto a folder with the tests you provide and runs the tests against the exemplar. So, for local development you probably want to keep editingpanic_recover.goand implement the solution there, just so you have the tests in the same folder of the solution. When you want to run that solution here in CI copy your implemented solution frompanic_recover.goto.meta/exemplar.goand push. When you feel you have the code for the exemplar completely ready and you won't do any more code changes, you can replace the code inpanic_recover.goto have the stub and leave the solution in the exemplar.Also, instead of
go/exercises/concept/panic-recoverwe tend to have simpler module/package names for the exercises. The module/package can just be called something likepanicrecoverin this case.
thanks @andrerfcsantos will update the code as you said
@myworkcircle It has been a few days since the last update to this PR. Are you still working on this? Can we help with anything?
I'm just asking to know if you are no longer interested in working on this or if you just got busy, or if you are stuck with something. If you just got busy, there's no problem. There's no rush from our side, so don't let this comment pressure you - take your time to finish this. If you are no longer interested in this, that's fine too, just let us know.
Hey Andre,
Sorry for delay in the task. Actually i had started the task then i got stuck with writing the test cases. As to how to write test cases to check for panic itself.
Recently i got occupied with some personal issues, so couldn't give time to this task.
I would say that although im interested in the task. But seeing the current turn of events i will not be able to again start this task for sometime, due to some tight schedule for some launches. Really sorry for this.
I understand that task has gotten a lot delayed, So im perfectly fine if you want to assign this task to someone else.
I can later see how the other person has implemented it and discuss on the same if i have any doubts. Eventually i believe the goal is to learn and help the community.
Thanks and Regards, Pallav Agarwal
On Fri, 15 Apr, 2022, 6:52 pm AndrΓ© Santos, @.***> wrote:
@myworkcircle https://github.com/myworkcircle It has been a few days since the last update to this PR. Are you still working on this? Can we help with anything?
I'm just asking to know if you are no longer interested in working on this or if you just got busy, or if you are stuck with something. If you just got busy, there's no problem. There's no rush from our side, so don't let this comment pressure you - take your time to finish this. If you are no longer interested in this, that's fine too, just let us know.
β Reply to this email directly, view it on GitHub https://github.com/exercism/go/pull/2133#issuecomment-1100106776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIVDPA5BD4QSVUPVZ27I7FLVFFUQ3ANCNFSM5RFDSPDA . You are receiving this because you were mentioned.Message ID: @.***>
@myworkcircle No problem, thanks for letting us know. We won't assign it to anyone for now, so feel free to come back at any time.
To test for panics, maybe you can take as inspiration the way the testify.assert package does it. They have several tests for testing for panics, and you can check their source code. For instance, something like this would be an easy way to check for a panic: assertions.go
Hello contributor and thank you for your contribution!
This pull request has been automatically marked as stale because it has not had recent activity. Please update the PR when you are able.
If this pull request is waiting on the maintainer, please apply the status/awaiting-maintainer label (and remove the status/awaiting-contributor label).
If no action is taken in the next week, this pull request will be automatically closed.
I am sorry but I will have to put this on hold for now.
Here the official note about this:
We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being closed.
That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.