Quiz · Functions · lesson 4 of 10Quiz — multiple resultsHow do multiple and named return values work in Go?[A]A Go function can return several values at once, idiomatically a (T, error) pair returned as return val, err. Named results are declared without any value until the body assigns one, and a naked return returns nothing at all, so a function with named results must still list its values after return. In an assignment the caller binds every result and discards the unwanted ones with the blank identifier _.[B]A Go function can return several values at once, idiomatically a (T, error) pair returned as return val, err. Named results are variables that start at their zero values and stay in scope for the whole body, so a naked return sends back their current values. The caller may assign both results to one variable, x := f(), and read them later as a pair.[C]A Go function can return several values at once, idiomatically a (T, error) pair returned as return val, err. You can also name the results: named results are pre-declared variables that start at their zero value and stay in scope for the whole body, enabling a naked return that sends back their current values. In an assignment the caller binds every result, discarding unwanted ones with _.[D]A Go function can list several result types, such as a (T, error) pair, but return val, err hands back only the first value and drops the rest, so each extra result needs its own function. Named results are variables that start at their zero values and stay in scope for the whole body, and a naked return sends back their current values.Subscribe to take the courseThe course is free. Sign in with Telegram and subscribe to the channel to open every lesson.Continue with TelegramSign in another way← BackMultiple resultsNext →Recursion