miguelmota / go-coinmarketcap

The unofficial CoinMarketCap API client for Go.

Home Page:https://github.com/miguelmota/go-coinmarketcap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This needs released versions and or tags for dependent projects?

richard-mauri opened this issue · comments

I am trying to fold in "go mod" to a dependent project as part of issue vault-ethereum

I see this project introduced "go mod" recently.
Can someone shed some light on getting vault-etherum to depend on a stable version of this proect?
I see no releases nor tags so this is a fragile dependency hell unless I'm missing something.

I think the recent commit bf4a9c7 broke the vault-ethereum dependency @miguelmota ?

@richard-mauri thanks for reporting

created a release and will be doing that from now on

I don't see vault-ethereum using go dep or go mod so dependencies will certainly break for that package. typically dependencies are locked to a particular revision so that package wouldn't of broken if using a dependencies manager

suggest that vault-ethereum uses go mod

export GO111MODULE=on
go mod init
go mod vendor

@miguelmota I created a PR to introduce "go mod" into vault-ethereum
That PR includes reference to one of your prior commits as there is some kind of breaking API recently in your code?

I tried to build against your new release and it is back to the breaking change.

Can you please advise?

Must vault-ethereum refactor to use your new version/api?
See below for my session transcript

Richards-MacBook:vault-ethereum richardmauri$ go get github.com/miguelmota/go-coinmarketcap/pro/v1@v0.1.0
go: finding github.com/miguelmota/go-coinmarketcap/pro v0.1.0
go: finding github.com/miguelmota/go-coinmarketcap v0.1.0
go: downloading github.com/miguelmota/go-coinmarketcap v0.1.0
Richards-MacBook:vault-ethereum richardmauri$ echo $GOPATH

Richards-MacBook:vault-ethereum richardmauri$ !exp
export GO111MODULE=on
export GOPATH=/Users/richardmauri/gopath
Richards-MacBook:vault-ethereum richardmauri$ rm /Users/richardmauri/gopath/bin/vault-ethereum
Richards-MacBook:vault-ethereum richardmauri$ go install
go: finding github.com/miguelmota/go-coinmarketcap v0.1.0
go: downloading github.com/miguelmota/go-coinmarketcap v0.1.0

github.com/immutability-io/vault-ethereum

./path_convert.go:206:25: client.CryptocurrencyListingsLatest undefined (type *coinmarketcap.Client has no field or method CryptocurrencyListingsLatest)
./path_convert.go:206:56: undefined: coinmarketcap.CryptocurrencyListingsLatestOptions

Richards-MacBook:vault-ethereum richardmauri$ git status
On branch use-go-mod-and-fix-build
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   go.mod
modified:   go.sum

no changes added to commit (use "git add" and/or "git commit -a")
Richards-MacBook:vault-ethereum richardmauri$ git diff go.mod
diff --git a/go.mod b/go.mod
index 261c188..cfb85c3 100644
--- a/go.mod
+++ b/go.mod
@@ -20,7 +20,7 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/vault v1.0.2
github.com/mattn/go-isatty v0.0.4 // indirect

  •   github.com/miguelmota/go-coinmarketcap v0.0.0-20190131021944-b0b8fc089275
    
  •   github.com/miguelmota/go-coinmarketcap v0.1.0
      github.com/mitchellh/go-testing-interface v1.0.0 // indirect
      github.com/mitchellh/mapstructure v1.1.2 // indirect
      github.com/pborman/uuid v1.2.0
    

Richards-MacBook:vault-ethereum richardmauri$ git diff go.sum
diff --git a/go.sum b/go.sum
index 3c45dfe..f191f3a 100644
--- a/go.sum
+++ b/go.sum
@@ -70,6 +70,8 @@ github.com/miguelmota/go-coinmarketcap v0.0.0-20190131021944-b0b8fc089275 h1:PHu
github.com/miguelmota/go-coinmarketcap v0.0.0-20190131021944-b0b8fc089275/go.mod h1:DiJzcx5WIEUZu9bNpwGtAMmIOt5e+Oa+itXlNfEVTm4=
github.com/miguelmota/go-coinmarketcap v0.0.0-20190203133305-bf4a9c70cc07 h1:qhVG5RJYUgcifYyRw/r6cgGhNJmGduqz9cxH13T8EL4=
github.com/miguelmota/go-coinmarketcap v0.0.0-20190203133305-bf4a9c70cc07/go.mod h1:Jdv/kqtKclIElmoNAZMMJn0DSQv+j7p/H1te/GGnxhA=
+github.com/miguelmota/go-coinmarketcap v0.1.0 h1:ZQJuzyYK6QaqZv9QoyVTIB5vzewCm+d4nX7bVtMS1+k=
+github.com/miguelmota/go-coinmarketcap v0.1.0/go.mod h1:Jdv/kqtKclIElmoNAZMMJn0DSQv+j7p/H1te/GGnxhA=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=