Golang implementation of k-NN algorithm (for k = 1)