Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Multiple Return Values | Functions
Introduction to GoLang

Multiple Return ValuesMultiple Return Values

Similar to passing multiple arguments into a function, we can also retrieve multiple data values from the function.

The syntax for defining a function with multiple return values is as follows:

Below is an example of a function that returns two distinct values:

go

index.go

The returned values can be stored using the following syntax:

go

index.go

Complete the following code by selecting an appropriate answer:

Select the correct answer

Everything was clear?

Section 4. Chapter 5
course content

Course Content

Introduction to GoLang

Multiple Return ValuesMultiple Return Values

Similar to passing multiple arguments into a function, we can also retrieve multiple data values from the function.

The syntax for defining a function with multiple return values is as follows:

Below is an example of a function that returns two distinct values:

go

index.go

The returned values can be stored using the following syntax:

go

index.go

Complete the following code by selecting an appropriate answer:

Select the correct answer

Everything was clear?

Section 4. Chapter 5
some-alt