fix: fix inconsistent definition of assertError
function in maps section
#765
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
assertError
in the maps section is introduced here:learn-go-with-tests/maps.md
Lines 222 to 228 in 7c5b39c
as you can see with the failure error being
got error "X" want "Y"
This does not match the v1 go code:
learn-go-with-tests/maps/v1/dictionary_test.go
Line 18 in 7c5b39c
Further down the section the
assertError
helper is refactored:learn-go-with-tests/maps.md
Lines 367 to 375 in 7c5b39c
to update the failure error to
got "X" want "Y"
(withouterror
)This does not really make much sense and is also not reflected anywhere in the section's go code (see: v2, v3, ..., v7)
So this PR is amending the erroneous v1 go code and removing the unnecessary/incorrect refactoring