Contour Integration where Contour contains singularity

There are many theorems in complex analysis which tell us about integration $\int_{\gamma} f$ where $f$ is continuous (or even differentiable) in the interior of $\gamma$ except finitely many points.

I would like to see how should we solve $\int_{\gamma}f(z)dz$ where $\gamma$ contains a singular point of $f$.

For example, in solving $\int_{|z|=1} \frac{1}{z-1}dz$, I slightly pulled the curve $|z|=1$ near $1$ towards left, so that $\gamma$ will not contain $1$; then the singularity of $\frac{1}{z-1}$ will not be inside this deformed curve, so integration over deformed curve is zero, so taking limit, I concluded that $\int_{|z|=1} \frac{1}{z-1}dz=0$.

However, if I pull the curve near $1$ on the right side, then the singularity of $\frac{1}{z-1}$ will be inside this deformed curve, and integration is then non-zero.

I confused between these two processes; can you help me what is the correct way to proceed for finding integration along curves, in which singularity of the function is on the curve?

Solutions Collecting From Web of "Contour Integration where Contour contains singularity"