Hypothesis: Suppose that $F(z)$ has $f(z)$ as a derivative. Suppose further that $F(z)$ is analytic. Now consider the complex line integral
$$ \tag{1} \int_\gamma f(z)\ dz $$
Question: Does this imply that $(1)$ is equal to zero if $\gamma$ is a closed curve? If so, why?
Attempt:
There is a theorem that says that for $\gamma$ a closed curve, we have that
$$ \int_\gamma p\ dx + q\ dy = 0 \iff p\ dx + q\ dy \text{ is an exact differential} $$
Then $f(z)\ dz = f(z)\ dx + i f(z)\ dy$ implies that
$$ f(z)\ dz = f(z)\ dx + i f(z)\ dy = \underbrace{{\partial F \over \partial x}\ dx + i \left(- i{\partial F \over \partial y}\right)\ dy}_{\text{applying CR-equations to $F(z)$}} = {\partial F \over \partial x}\ dx + \left({\partial F \over \partial y}\right)\ dy $$
Then $f(z)\ dz = dF = {\partial F \over \partial x}dx + {\partial F \over \partial y} dy$ so that $f(z)\ dz$ is an exact differential as desired.
Then via $(1)$ we have that
$$ \int_\gamma f(z)\ dz = 0 $$
as desired.
Is my proof correct?