Compute the line integral $\int_y e^z dz$ where $y$ is the line segment from $0$ to $z_0$.
Since there is only one variable z here, I can directly compute $\int_y e^z dz=\int_0^{z_0} e^z dz=e^{z_0}-1$. I assume $z_0$ means a fixed point. Am I missing something or is this it?
It is not that "there is only one variable $z$ there" you can directly do so, but that when $f$ has a primitive $F$, i.e., $F'(z)=f(z)$ in the domain (that contains the path $\gamma$), $$ \int_\gamma f(z)=F(B)-F(A) $$ where $A$ is the initial of $\gamma$ and $B$ the final point of $\gamma$.
In general, you can't calculate $\int_\gamma f(z)dx$ in this way. Consider for instance $f(z)=\frac{1}{z}$.