Integrating $\frac {e^{iz}}{z}$ over a semicircle around $0$ of radius $\epsilon$ I am trying to find the value of $\int_{-\infty}^{\infty} \frac{\sin (x)}{x}$ using residue theorem and a contour with a kink around $0$. For this, I need to find $\int_{C_\epsilon} \frac {e^{iz}} {z}$ where $C_\epsilon$ is the semicircle centred at $0$ with radius $\epsilon$ from $-\epsilon$ to $\epsilon$. I guess it is equal to half the residue of $\frac {e^{iz}} {z}$ at $0$. Is this true? Any help is appreciated.

Note that $\dfrac{e^{iz}}{z}=\dfrac1z+O(1)$. Integrating this counter-clockwise around the semicircle of radius $\epsilon$ is
$$
\begin{align}
\int_\gamma\frac{e^{iz}}{z}\,\mathrm{d}z
&=\int_0^\pi\left(\frac1\epsilon e^{-i\theta}+O(1)\right)\,\epsilon\,ie^{i\theta}\,\mathrm{d}\theta\\
&=\int_0^\pi\frac1\epsilon e^{-i\theta}\,\epsilon\,ie^{i\theta}\,\mathrm{d}\theta
+\int_0^\pi O(1)\,\epsilon\,ie^{i\theta}\,\mathrm{d}\theta\\[9pt]
&=\pi i+O(\epsilon)\\[12pt]
\end{align}
$$
The residue at $0$ is $1$, so integrating around the full circle would give $2\pi i$.
