2 ms·
Although I agree with you about encouraging interface{} (there is even a "proverb" against its usage), you cannot read an empty interface as a type it is not.
by dullgiulio 9y ago
Although I agree with you about encouraging interface{} (there is even a "proverb" against its usage), you cannot read an empty interface as a type it is not.
Unlike C void-pointer, interface{} is the tuple (type, value) and you need a type assertion for the right tipe to get the value.