DEV Community

Discussion on: Rate limiting HTTP requests in Go using Redis

Collapse
 
gmarcial profile image
Guilherme Marcial

I understand this is a case where a forced check is being done to see if the type counterStrategy/sortedSetCounter implements the Strategy interface at compile time.

In cases where this is not being done implicitly in some part of the code, you force this check explicitly, ensuring that you know that the type counterStrategy/sortedSetCounter continues to satisfy the interface contract at compile time.

More details here/reference: go.dev/doc/effective_go#blank_impl...

Collapse
 
pararang profile image
Muhammad Ikhsan

Thank you for the explanation, @gmarcial.