-
Notifications
You must be signed in to change notification settings - Fork 95
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
Do not panic on genji version when compiled in GOPATH mode #262
Conversation
The genji version command relies on the versions of modules compiled in as debug info. Those are unavailable when compiling Genji with go get. This makes genji version display a message saying the version is not available if genji has been built with go get.
I was thinking of returning an additional error code with |
Related issue: #261 |
cmd/genji/main.go
Outdated
cliVersion = info.Main.Version | ||
|
||
if !ok { | ||
fmt.Println("version not available in GOPATH mode") |
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.
Perhaps we should suggest running go get
with modules enabled? Something like
fmt.Println("version not available in GOPATH mode; use \"go get\" with Go modules enabled")
@tdemin thanks for this change, nice catch! I’ve added a minor suggestion for the GOPATH mode message. |
@tie sure thing, just added a notice on using modules. |
Codecov Report
@@ Coverage Diff @@
## master #262 +/- ##
=======================================
Coverage 61.32% 61.32%
=======================================
Files 68 68
Lines 6345 6345
=======================================
Hits 3891 3891
Misses 1938 1938
Partials 516 516 Continue to review full report at Codecov.
|
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.
Thanks @tdemin !
The
genji version
command relies on the versions of modules compiled in as debug info. Those are unavailable when compiling Genji withgo get github.com/genjidb/genji/cmd/shell
(in GOPATH mode). This makesgenji version
display a message saying the version is not available if genji has been built withgo get
.Sample output: