fix the build on go 1.0.x in functions with returns inside of loops