In this PR I expanded on the Delete method in the maps chapter to be consistent with other CRUD operations in the case that the word being deleted does not exist. The same Update switch structure is used to capture errors with a minor change ErrWordDoesNotExist to make it applicable to both update and delete operations.
it seems like the current version is more consistent with the language. since delete(map, key) doesn’t return anything, and will do nothing if the specified key doesn’t exist in Go.
In this PR I expanded on the
Delete
method in the maps chapter to be consistent with other CRUD operations in the case that the word being deleted does not exist. The sameUpdate
switch structure is used to capture errors with a minor changeErrWordDoesNotExist
to make it applicable to both update and delete operations.