educative.io

Incorrect code example

The last code example that gives enumeration a type name is incorrect:

type Gender int
const (
UNKNOWN = iota
FEMALE
MALE
)

The correct code should be:

type Gender int
const (
UNKNOWN Gender = iota
FEMALE
MALE
)

Kindly correct it.

Type your question above this line.

Course: https://www.educative.io/collection/10370001/6289391964127232
Lesson: https://www.educative.io/collection/page/10370001/6289391964127232/4988365034225664

Hi @Emmanuel_Idika

I am Usman from Educative. Thank you for pointing out the issue in the lesson code. The error has been fixed now.
Thanks once again!