You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using var _ http.Handler = (*Handler)(nil) is a great idea to make sure that Handler implements http.Handler properly.
What if both the interface and the struct using generic?
For example:
typeScoreinterface {
int64|float64
}
typeScoreCalculator[TScore] interface {
Add(scoreT) T
}
typeSampleAlgorithm[TScore] struct {}
func (s*SampleAlgorithm[T]) Add(scoreT) T {
// do some manipulationreturnscore
}
Using
var _ http.Handler = (*Handler)(nil)
is a great idea to make sure thatHandler
implementshttp.Handler
properly.What if both the interface and the struct using generic?
For example:
Should I use both types for verifying compliance?
The text was updated successfully, but these errors were encountered: