The way I prove the fundemental theorem of complex integrals is as follows:
$$\int_\gamma f'(z)dz = \int_a^b f'(\gamma(t))\gamma'(t)dt = \int_a^b g'(t)dt = g(b)-g(a)=f(z_2)-f(z_1)$$
Where in the first equality, I parametrized using the variable $t$, and in the second equality, I defined a new function $g(t) \equiv f(\gamma(t))$, so $g'(t)=f'(\gamma)\gamma'(t)$.
The thing is, the path can be defined however I want. So I can define a path that can around a pole ($\gamma_1$), and another that takes a straight line ($\gamma_2$) and get the same result. This gives a contradiction:
$$\int_{\gamma_1} f'(z)dz = \int_{\gamma_2}f'(z)dz$$
$$\int_{\gamma_1}f'(z)dz - \int_{\gamma_2} f'(z)dz = 0 \implies \oint f'(z) dz=0$$
Even though the path encircles a pole. was is the mistake I made?
What I thought of is that the problem was in taking the derivative $f'(z)$ even though there is a pole. It's not possible because it is no longer holomorphic. The thing is, given a circle centered at the pole such that the function $f'(z)$ is holomorphic outside of it, then wouldn't that get around the problem? So what is the mistake?