Tracks
/
Go
Go
/
Exercises
/
Zero, Zilch, Nada
Zero, Zilch, Nada

Zero, Zilch, Nada

Learning Exercise

While completing Zero, Zilch, Nada, you'll learn 2 concepts

Instructions

In this exercise, we will write some simple functions that return zero values for various Go types. Some types you might not have seen before. They will be introduced in detail in later exercises.

1. Return an empty bool

Adjust the EmptyBool function to return an empty bool.

2. Return an empty int

Adjust the EmptyInt function to return an empty int.

3. Return an empty string

Adjust the EmptyString function to return an empty string.

4. Return an empty func

Adjust the EmptyFunc function to return an empty func.

5. Return an empty pointer

Adjust the EmptyPointer function to return an empty pointer.

6. Return an empty map

Adjust the EmptyMap function to return an empty map.

7. Return an empty slice

Adjust the EmptySlice function to return an empty slice.

8. Return an empty channel

Adjust the EmptyChannel function to return an empty channel.

9. Return an empty interface

Adjust the EmptyInterface function to return an empty interface.

Last updated 21 September 2021
Edit via GitHub The link opens in a new window or tab
Go Exercism

Ready to start Zero, Zilch, Nada?

Sign up to Exercism to learn and master Go with 20 concepts, 124 exercises, and real human mentoring, all for free.