🚀 Get 25% off access to all my premium courses - use discount code FUNCMAIN at checkout - view the pricing page now!

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().

Further Reading:

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


Other Challenges