Suppose $G$ is an open set and let $f:G \longrightarrow \mathbb C$ be a continuous function and assume $f$ is analytic on $G \setminus S$ where $S$ is a straight line joining $a$ and $b$ where $a,b \in G$. Then using Morera's theorem show that $f$ is analytic in $G$.
For any triangular region $T$ in $G$ not intersecting $S$ it is easy to see that $\int_{\partial T} f(z)\ dz = 0$ since $G \setminus S$ is also open. For the cases when one of the vertices of $T$ is lying on $S$ or $S$ is lying on a side of the triangle then how can I tackle those cases? Other cases will be dependent on these two cases. Please help me.
Thank you in advance.