Help with golang code to copy docker repo from one to another

Hi, We are working on a project, which needs us to copy the docker repo from one registry to another or even in same registry, we might need to copy from one repo to another. I have written the code in golang, however code fails in uploading layers. Can someone please help? https://gist.github.com/codervinod/1d06fdb9fab1887e9981c30996270389