"cannot find module providing for package" in go

Im trying to install the official go docker client by importing

“github.com/docker/docker/client”

But i get the following error

cannot load github.com/docker/distribution/reference: cannot find module providing package github.com/docker/distribution/reference

My go version is 1.12 and
my project is outside $GOPATH/src. My go.mod file looks like this.

module app

go 1.12

require (
  github.com/Microsoft/go-winio v0.4.14 // indirect
  github.com/docker/docker v1.13.1
  github.com/docker/go-connections v0.4.0 // indirect
  github.com/docker/go-units v0.4.0 // indirect
  golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect
)

Source: StackOverflow