Hi!

On Fri, Apr 13, 2018 at 12:41:35PM -0700, Lee Painton wrote:
> The only situation in which this limit has seemed unreasonable is when a
> large number of independent cases followed a selection function (a large
> case statement), which was allowed.

Another situation is function which does validation of complex data
received from outside - like checking flags in main() or http.Request in
http handler func or similar RPC handler func.

Refactoring these to fit any cyclomatic limit also makes code worse and
not worth it. But increasing global limit because of these exceptional
cases doesn't makes any sense - instead, just add pragma to such func: 
    func validateSomething() { // nolint:gocyclo

Just try to avoid mixing such a validation logic with another logic in
same function.

-- 
                        WBR, Alex.

-- 
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