2017-02-09 1 views
-1

J'utilise Glide pour gérer mes dépendances golang, mais en essayant de construire mon projet sur un environnement propre, le répertoire vendor est d'être ignorer:Glide utilisation du gestionnaire de paquets

./glide install 
[INFO] Downloading dependencies. Please wait... 
[INFO] --> Found desired version locally github.com/dustin/go-humanize 7a41df006ff9af79a29f0ffa9c5f21fbe6314a2d! 
[INFO] --> Found desired version locally github.com/jaxxstorm/flexvolume b65378104ef0f49af77d6f73d87da7e78d0f8252! 
[INFO] --> Found desired version locally github.com/kolyshkin/goploop-cli 5365b446a713e31ac4f2026b05a6dac27bbdf21c! 
[INFO] --> Found desired version locally github.com/urfave/cli 0bdeddeeb0f650497d603c4ad7b20cfe685682f6! 
[INFO] Setting references. 
[INFO] --> Setting version for github.com/kolyshkin/goploop-cli to 5365b446a713e31ac4f2026b05a6dac27bbdf21c. 
[INFO] --> Setting version for github.com/dustin/go-humanize to 7a41df006ff9af79a29f0ffa9c5f21fbe6314a2d. 
[INFO] --> Setting version for github.com/urfave/cli to 0bdeddeeb0f650497d603c4ad7b20cfe685682f6. 
[INFO] --> Setting version for github.com/jaxxstorm/flexvolume to b65378104ef0f49af77d6f73d87da7e78d0f8252. 
[INFO] Exporting resolved dependencies... 
[INFO] --> Exporting github.com/urfave/cli 
[INFO] --> Exporting github.com/jaxxstorm/flexvolume 
[INFO] --> Exporting github.com/dustin/go-humanize 
[INFO] --> Exporting github.com/kolyshkin/goploop-cli 
[INFO] Replacing existing vendor dependencies 

Tous les fournisseurs DEPS sont là

vendor 
└── github.com 
    ├── dustin 
    │   └── go-humanize 
    ├── jaxxstorm 
    │   └── flexvolume 
    ├── kolyshkin 
    │   └── goploop-cli 
    └── urfave 
     └── cli 
      ├── altsrc 
     └── autocomplete 

11 répertoires

mais mon projet ignore encore le vendeur dir:

go build -o ploop main.go 
    main.go:4:2: cannot find package "github.com/jaxxstorm/flexvolume" in any of: 
     /usr/lib/golang/src/github.com/jaxxstorm/flexvolume (from $GOROOT) 
     /tmp/go/src/github.com/jaxxstorm/flexvolume (from $GOPATH) 
    main.go:7:2: cannot find package "github.com/kolyshkin/goploop-cli" in any of: 
     /usr/lib/golang/src/github.com/kolyshkin/goploop-cli (from $GOROOT) 
     /tmp/go/src/github.com/kolyshkin/goploop-cli (from $GOPATH) 
    main.go:8:2: cannot find package "github.com/urfave/cli" in any of: 
     /usr/lib/golang/src/github.com/urfave/cli (from $GOROOT) 
     /tmp/go/src/github.com/urfave/cli (from $GOPATH) 

Je ne pense pas que je dois mettre GOVENDOREXPERIMENT parce que je utilise go1.7.4

+0

Vous ne construisez pas un package, vous venez de créer un seul fichier. Construisez ou installez votre paquet par son chemin d'importation, ou depuis le répertoire principal du paquet. – JimB

+0

Désolé, pas suite par ici, pouvez-vous élaborer? – jaxxstorm

+0

Tapez 'aller build full/import/path' ou simplement' go build' depuis votre projet. – JimB

Répondre

0

Très stupide vraiment, le git doit aussi être dans le $GOPATH. J'ai symbolisé mon repo à $GOPATH/src/github.com/vendor/project et tout a fonctionné.

+1

N'utilisez pas un lien symbolique dans votre GOPATH Les liens symboliques sont ignorés par les outils de construction dans la plupart des cas, il suffit de suivre la documentation: https://golang.org/doc/code. html – JimB