Cauchy-Goursat theorem 

I understand the solution to this question via the use of the following corollary

However for $k+1=0$ you get :
$\displaystyle \oint_0^{2\pi}id\theta$
Why am I not able to apply the cauchy-goursat theorem to get that the integral=0?

You can apply it if $k\geq 0$ (because $z\mapsto z^k$ is holomorphic on $\gamma \cup\operatorname{int}(\gamma )$, but not for $k<0$, because the function is not holomorphic on all of $\Omega$ because there is a singularity in $z=0\in\gamma \cup\operatorname{int}(\gamma )$. For example, for $k=-1$, by using the Cauchy formula you get:
$$\oint_{\gamma}\frac{1}{z}dz=2\pi i.$$
remark: You can't apply your corollary here, because $z\mapsto \frac{1}{z}$ is not continuous on $\Omega$ (because it's not continuous in $z=0$)
