Open junedev opened 2 years ago
Two notes (per #2013)
errors.Is
is recommended instead of ==
unless there is a specific reason not to unwrap the error. See #2013 for background discussion.
Putting this on hold because of https://github.com/exercism/go/issues/2492.
Getting Started
If you have not yet contributed to concept exercises before, this task requires some upfront reading to acquire the necessary background knowledge.
Here you can read about what Concept Exercises are and how they are structured:
Also be aware of these general guidelines.
Goal
The goal here is to create a new concept exercise that teaches error wrapping. That includes writing a concept and creating a new exercise.
Concepts
The following concept needs to be created. You can use the introduction.md file of the concept also as introduction.md file of the exercise. No need to create different content at this point. Additionally, if you want to save some time it is ok to not have an extensive about.md at this point. It can also be mainly the instruction.md content, maybe with some additions you would like to make.
error-wrapping
Learning Objectives
In the concepts the student should learn about the following topics and then practice them in the concept exercise.
errors.Is
anderrors.As
Unwrap
method for custom errorsThe about.md file could additionally mention ...
We could potentially add some other advanced error topics if there are ideas.
Out of Scope
Prerequisites
errors
interfaces
type-assertions
Other prerequisites should be added as needed to solve the specific exercise.
Story Idea
There is probably no exercise that can be ported directly because Go's error handling is so special but here are some error related exercises from other tracks. The story could maybe be re-used even if we need to change the actual tasks.
Resources
Here some links that might be helpful as a starting point and/or for the links section of the concept:
Implementation Notes
error-wrapping
concept folder and config.json entry already exists. No need to create those.deep-thought
that should be used and a config.json entry as well. You can rename the exercise folder, the slug and the exercise name to whatever you like, just keep the uuid fixed. You can remove the current content of the "Deep Thought". There was an issue in the past that there were two exercises started that were supposed to teacherrors
. In the end, one was actually finished up ("The Farm"). If we re-use the uuid of "deep-thought" we don't have to deprecate the exercise and have the "dead" folder lying around. As mentioned before, everything besides the UUID can be safely changed. "Deep Thought" was never finished/live.How to proceed