Ramer-Douglas–Peucker algorithm in golang