Challenge 07 - Minimums, Maximums and Errors Image Challenge 07 - Minimums, Maximums and Errors

👋 Welcome Gophers! In this challenge, we’ll be testing your ability to handle edge cases and work with the errors package.

In this challenge, you have the task of implementing the GetMinMax function which will take in a slice of type Flight.

The function will return 3 values:

  • min - The cheapest price from the list passed in.
  • max - The most expensive price from the list passed in.
  • error - Any error values should there be issues with the list passed in.
Hint

You can create new errors using the error package and calling errors.New().

See the Solution

Feel free to have a look at the forum discussion thread for this challenge and contribute with your own solutions here - Challenge 07 - Minimums, Maximums and Errors

Further Reading:

If you like this challenge then you may also appreciate some of the following articles on the site:


Other Challenges