Check out the proof for the following corollary.

This is only the first part of the proof and I have a issue with this. $F(z)$ is defined by integrating $f$ along a line segment. But isn't it necessary for it to be defined on a general path so that it confirms that it is well defined? I know for a fact that F is well defined using the Cauchy-Goursat theorem but this appears in the text before the general Cauchy Goursat Thoerem and this uses only the Triangle version of it. This confuses me and hope someone could help me out. Thanks
EDIT The following says that F is well defined means it is path independent

The thing is that you don't really want to prove that the integral is path-independent. You define your function $F$ as an integral over this particular line segment. Now, you prove that $F'(z) = f(z)$. So, by definition, $F$ is the primitive of $f$.
The fact that this integral exists should be clear from the analycity of $f$, which implies that it is continuous along any line segment (or curve) in $D$ and this line segment (or curve) is a compact.