我如何才能适当地供应商github.com/docker/docker?

here my main.go

package cmd

import (
    "context"
    "fmt"

    "github.com/docker/docker/api/types"
    "github.com/docker/docker/client"
)

func main() {
    cli, err := client.NewClientWithOpts(client.WithVersion("1.38"))
    if err != nil {
        panic(err)
    }

    networks, err := cli.NetworkList(context.Background(), types.NetworkListOptions{})
    if err != nil {
        panic(err)
    }
    fmt.Println(networks)
}

i tried to run dep init but vendor folder ended up with an older version of docker/docker because the newest tag is 17.05 tried to pin the actual commit but that did not work either

i give a shot to go mod vendor but that also rely on git tags

Strangely enough docker/docker is an alias to moby/moby and docker/engine.

Anyone could explain me and give example how can i successfully use vendoring with docker API?

[[constraint]]
  name = "github.com/docker/docker"
  branch = "master"

[[override]]
  name = "github.com/docker/distribution"
  branch = "master"

Actually this two entries helped solve the dependency issue in Gopkg.toml, then running dep ensure