Errata

Go Cookbook

Errata for Go Cookbook

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
O'Reilly learning platform ch 14

Error handling for Stack's peek has wrong error message "empty queue".

func (s *Stack) Peek() (el any, err error) {
if s.IsEmpty() {
err = errors.New("empty queue")
return
}
el = s.elements[len(s.elements)-1]
return
}

Piotr Wera  Apr 12, 2024