ThinkComplexity code ported to go