5

There are expressions such as:

  • getting from a map (value, pres)
  • asserting a type (typed value, ok)

Where there are multiple values returned, but they can be assigned to a single value context, with unsuccessful conditions causing a panic instead.

Can I make my own function work like that, allowing it to be used in a single value context and panicking on errors?

Mihail Malostanidis
  • 2,686
  • 3
  • 22
  • 38

0 Answers0