S SearchRSS
< BackHome
Newest questions tagged go - Stack Overflow

How do I constrain a generic type to allow struct types that embed a given type?

I have a base struct like this: type State struct { Alerts []string } And two structs that embed it, like this: type StateA struct { State A string } type StateB struct { State B int } I also have

View original source