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