Re: [go-nuts] [generics] Embedding interfaces

2021-05-08 Thread Viet Nguyen
Awesome. Thanks muchly On Sat, May 8, 2021 at 11:40 PM Ian Lance Taylor wrote: > > On Fri, May 7, 2021 at 11:08 AM Viet Nguyen wrote: > > > > I'm trying to convert this code to use generics: > > > > type Cache interface { > > GetIfPresent(interface{

[go-nuts] [generics] Embedding interfaces

2021-05-07 Thread Viet Nguyen
Hi, I'm trying to convert this code to use generics: type Cache interface { GetIfPresent(interface{}) (interface{}, bool) } type LoadingCache interface { Cache Get(interface{}) (interface{}, error) } However, I couldn't find any way to include Cache[K, V] in LoadingCache[K, V]. (No similar use