Can someone help me understand whats the main difference two different
UserType in below snippet.?
More importantly when to use which.
```
type UserType string
const (
Undefined UserType = "undefined"
Admin UserType = "admin"
)
type UserType int
const (
Undefined UserType = iota
Admin
)
pass an interface as a
> different interface, the static information of what methods are on that
> interface gets erased. If you want to preserve this type information, you
> need to pass a non-interface type (such as a pointer to an interface).
> * Usage of reflect is subtle and
Sry for the typo. Its true that Kind() returns "Invalid" if IsValid returns
False. But still docs seems to be misleading. It says "If v is the zero
Value (IsValid returns false), Kind returns Invalid."
according to doc, all the variables in the code supposed to have a kind of
"Invalid" (since a
doc for Value.Kind() says,
"If v is the zero Value (IsValid returns false), Kind returns Invalid."
but thats not true. I does return "Invalid" in case of interfaces. but not
for every type. It doesn't return "invalid" even if IsValid return false.
https://play.golang.org/p/wrVwCedf65
--
You