Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.4.0 and Modules #2

Open
aleph0ne opened this issue Jun 1, 2020 · 2 comments
Open

v0.4.0 and Modules #2

aleph0ne opened this issue Jun 1, 2020 · 2 comments

Comments

@aleph0ne
Copy link

aleph0ne commented Jun 1, 2020

When using go.mod and the official Aylien SDK for go and go modules, a go get pulls the old SDK of v0.4.0 and I cannot seem to update it.

This is an error: undefined: newsapi.NewAPIClient

This is in my go.mod file:
github.com/AYLIEN/aylien_newsapi_go v0.4.0

@joesweeny
Copy link

joesweeny commented Aug 28, 2021

I'm getting a similar issue when executing go get -u github.com/AYLIEN/aylien_newsapi_go it installs the v5.0.1 dependency.

When I explicitly try to install the v4.6.0 dependency I get the following error message:

require github.com/AYLIEN/aylien_newsapi_go: version "v5.0.1" invalid: module contains a go.mod file, 
so major version must be compatible: should be v0 or v1, not v5

It would be good to get an answer on this please.

@FrontSide
Copy link
Contributor

Thanks for bringing this to our attention. There is indeed a bug in our versioning and we will be working on a proper fix for this.

In the meanwhile, you can download any tagged version of the Go SDK by using the related git commit hash, rather than the version number, which can be found on the Releases page.

For example. To install v5.0.1, run

go get github.com/aylien/aylien_newsapi_go@1b42563

in your go module's directory.

In the go.mod file it will then show up as v0.4.1

require github.com/aylien/aylien_newsapi_go v0.4.1-0.20210810092433-1b425636697c

but you can simply ignore this. As long as the git sha matches that of the desired version on Github you are good to go.
You can also verify the version by checking the header of any go file in the downloaded package.
e.g.

$ cd $GOPATH/pkg/mod/github.com/aylien/[email protected]
$ head client.go

Will show that v5.0.1 is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants