Beginner Go (Golang)
Q25 / 100

What is embedding in Go?

Correct! Well done.

Incorrect.

The correct answer is B) Promoting a type's methods and fields into another struct by including it without a field name

B

Correct Answer

Promoting a type's methods and fields into another struct by including it without a field name

Explanation

type Animal struct { ... }; type Dog struct { Animal; Name string } embeds Animal. Dog has all Animal methods directly.

Progress
25/100