-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
V3: Fix to use the version of goa specified in go.mod file, when 'goa gen'/'goa example' #2182
Conversation
Thank you for the great issue report and the PR! A couple of questions:
Here the
Thank you again, this is a great contribution! |
Thank you for your comment !
So, I fixed to use
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks
cmd/goa/gen.go
Outdated
@@ -142,16 +142,34 @@ func (g *Generator) Write(debug bool) error { | |||
return err | |||
} | |||
|
|||
const GOMODENVKEY = "GOMOD" | |||
|
|||
func findGoMod() (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this function can never return an error which is good so the error return value can be removed.
Thinking a bit more about parsing |
bcce715
to
da4ef14
Compare
I replaced the third party package with a heuristic parser. |
It may be better to output the version of goa when go get. 🤔 |
The parser looks great! Thank you for making the change. I'm happy to merge the PR as is. |
That's all. |
go.mod
Outdated
@@ -13,6 +13,7 @@ require ( | |||
github.com/manveru/gobdd v0.0.0-20131210092515-f1a17fdd710b // indirect | |||
github.com/pkg/errors v0.8.1 | |||
github.com/sergi/go-diff v1.0.0 | |||
github.com/sirkon/goproxy v1.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops
I wonder if we need to print the version on the console? this may break scripts that wrap goa and capture its output. |
This reverts commit ad0de63.
Thank you! |
What about displaying the version of goa modules by 'go get', when 'goa version' command run? If it looks good, I create another pull request. |
Not sure about |
Fix issue #2181