The Go language was announced in 2009. Create an interface age with the age of the Go language. Suppose today the year is 2022, then the age would be 13.
After creating the interface, print out the data type of the interface's value:
- If the type is
nil, then printAge is nil type. - If the type is
int, printAge is int type. - If the type is
string, printAge is string type. - In all other cases print
Type is not defined.