-
Notifications
You must be signed in to change notification settings - Fork 710
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
Go Module #178
Comments
@cimnine I would like to clarify if understood correctly. You mean to say using By nature of resty package it will work seamlessly with But if we use FYI, resty package currently does not enforce package import like I understand, documentation on |
Yes.
This will work with plain
Yes. But: Everybody who updates their current project to Go modules will have to adjust all import statements in the project from What you do in v2 is up to you. The Go community suggests for major version increments to adjust the import path anyway, so switching from |
Okay, let's update the |
@cimnine I have updated the |
It's hard to test, because you'd have to release a new release to gopkg.in with the new |
@cimnine Yes you're correct. Directly we cannot get master via gopkg.in. But we can workaround that. I believe you have I'm at work, I will make a release by EOD when I get home. Thanks. |
I believe this is not how Go modules works. |
Thanks. I will make a release by EOD. |
Making |
It works now as expected! Thank you! |
When running
Not sure how to interpret that? |
@vvarp As part this #178 issue, go.mod is updated to On upcoming |
Sorry, I forgot to mention that my go.mod is using |
@vvarp How do you require go-resty in your Go code? Make sure that you |
I also have this issue. in go.mod:
import in go code: import "gopkg.in/resty.v1" go version go1.11 linux/amd64
|
It's all good. |
I don't think that's the cause, but the example test uses the wrong import path: https://github.com/go-resty/resty/blob/master/example_test.go#L19 Maybe if someone copied it and used it as template, then it would complain in |
@cimnine Thanks for your inputs. we both kind of doubted the same. @vvarp @zuf I'm able to replicate the issue you have mentioned with What I did?
Long story short, I have to update I will make an release when I get back to home. |
According to golang/go#24301 (
We should always write as
|
@leonsim both of us understanding about go mod spec correct. And you're point is valid about not to use However as you might have read this thread. I'm not planning introduce breaking change in minor version (I did before and reverted in
Let's aim for |
Thank you, @jeevatkm After I update |
@lanshipeng Could you please update the import path to Then you should be good. |
@jeevatkm but i don't know where to update the import path ,i can't find where |
@lanshipeng In your Go project search for And if you have a file |
@jeevatkm ,thank you. after i replace "github.com/go-resty/resty" with "gopkg.in/resty.v1 v1.10.2" ,it's run ok |
@lanshipeng You're welcome. |
I can't seem to get this working. I have cleared everything related to go-resty under GOPATH also fixed the import to be
|
@tsouza Please have a look this one #230 (comment) and try it out? |
@jeevatkm I have that fixed but still with the same issue. For now, I've dropped |
The documentation suggests that one should use resty as follows:
(https://github.com/go-resty/resty/blob/ec17de1c59a99e0743dac77aaab6435f364fdc42/README.md#usage)
But this brakes with Go modules, because
go.mod
declares the module as follows:resty/go.mod
Line 1 in ec17de1
This causes troubles when I try to compile code with go11.1rc2 and go modules enabled.
All is fine when I import resty like this:
Now there are two options:
a) Adjust the documentation and suggest to
import "github.com/go-resty/resty"
b) Adjust the
go.mod
to bemodule "gopkg.in/resty.v1
Option (a) is good for all new project that start with go modules right away, but it's backward incompatible.
Option (b) would be good for projects that used plain
go get
ordep
until now and upgrade togo.mod
, because they don't have to change all the import statements. There are no further drawbacks, except that this option needs a new release with an updatedgo.mod
.The text was updated successfully, but these errors were encountered: