On Thu, Nov 10, 2016, at 03:21 PM, Felix Geisendörfer wrote:
>
>> I would think that 99+% of all type checks are to determine whether
>> the supplied object provides additional functionality that can be
>> used. I'm struggling to think of a situation where you would type
>> check for the Flush method and then refuse to use the main
>> ResponseWriter methods if it were a Flusher.
>
> I agree. But verifying if you’re part of the 99% or 1% may be a very
> complex task, especially when using 3rd party http related packages.
>
> So why would I want to worry about this invariant holding for a large
> amount of source code, if I can fix the problem with a comparably much
> smaller amount of boilerplate?

You can't in the general case. You cover the interfaces that you
currently know about but you don't know what other interfaces people
are relying on. Sipporting those becomes a combinatorial problem of
whack-a-mole.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to