If this function panic'd then people who raise issues to make it not panic, or they would work around it with recover(), both of which would be in less tested code paths.
If this function accepted any integer for level and silently clamped it to a reasonable minimum or maximum value, then people would raise an issue to expose the value that was chosen. Returning an error is the least worst choice. On Thursday, 7 July 2016 09:58:16 UTC+10, Andy Balholm wrote: > > In this particular case, the only possible error is that the compression > level is invalid. The documentation says that the error will be nil if the > level is valid. -- 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.