将外部程序包添加到Hyperledger Fabric -go smartcontract

I am trying to add an external package to my go smartcontract (for installation , I ran : go get github.com/stripe/stripe-go) . I then imported files stripe "github.com/stripe/stripe-go" and charge "github.com/stripe/stripe-go/charge" , in my smartcontract (https://github.com/stripe/stripe-go). However, when I try to bring up my chaincode , I am getting the error :

Error: Error getting chaincode code chaincode: Error getting chaincode package bytes: Error obtaining dependencies for github.com/stripe/stripe-go: : failed with error: "exit status 1" can't load package: package github.com/stripe/stripe-go: cannot find package "github.com/stripe/stripe-go" in any of: /opt/go/src/github.com/stripe/stripe-go (from $GOROOT) /opt/gopath/src/github.com/stripe/stripe-go (from $GOPATH)

I tried adding the package through govendor (http://hyperledger-fabric.readthedocs.io/en/release-1.0/Style-guides/go-style.html) , but that also is not working .

Request you all to please hep me on this . Thanks in advance.

I had the similar issue. Govendor worked for me:

error getting chaincode package bytes: Error obtaining dependencies for github.com/go-ozzo/ozzo-validation/is

govendor add github.com/go-ozzo/ozzo-validation/is
govendor update +v
go build

And result was good:

Chaincode is installed on remote peer PEER2

UPDATE:

If you have a problem with vendor packages setup, here you go:

  1. create folder vendor in project root directory with empty valid json file (vendor.json)
  2. run command govendor add +external from root directory
  3. you can also update all dependencies with update command.