-
Notifications
You must be signed in to change notification settings - Fork 94
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
affected/package: mockgen更新有点随意 #180
Comments
Looks like the binary of mockgen is broken. I will update a new one. |
@forrestlinfeng Didn't reproduce, which os are you using? Windows? |
I have tried the new binary on Linux and macOS and didn't reproduce the error message. |
linux/mac,现在trpc create都跑不起来了
wineandchord ***@***.***> 于2024年5月21日周二 17:03写道:
… I have tried the new binary on Linux and macOS and didn't reproduce the
error message.
—
Reply to this email directly, view it on GitHub
<#180 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXXREG553VRN7D6SMQTE4TZDMEX7AVCNFSM6AAAAABIA5XVYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRSGEZTIMBXGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@forrestlinfeng Can you give detailed |
@forrestlinfeng I think I have figured out the root cause: The go src code here. Quoted as: // Default is the default Context for builds.
// It uses the GOARCH, GOOS, GOROOT, and GOPATH environment variables
// if set, or else the compiled code's GOARCH, GOOS, and GOROOT.
var Default Context = defaultContext() So, the newly compiled mockgen binary contains my GOROOT information. If users do not have Quick fix: export GOROOT="$(dirname "$(dirname "$(which go)")")" But I am still curious about on what occasion the GOROOT will not be set by default? And why there wasn't any error message previously (maybe the previous compiled GOROOT information coincides with the user's local environment)? |
What version of tRPC-Go are you using?
v0.0.1
trpc create遇到这个问题
trpc create err:exit status 1, reason:Execution err: running plugin
mockgen
, err: go mock mockgen err: cmd exec err: exit status 1, msg:2024/05/21 11:01:16 Loading input failed: makephoto.trpc.go:44:2: could not parse package trpc.group/trpc-go/trpc-go/server: go/build: go list trpc.group/trpc-go/trpc-go/server: fork/exec /Users/guoqizhou/go/go1.21.2/bin/go: no such file or directory , if the error is caused by 'go mod tidy' or 'mockgen', you may try adding '--nogomod' flag to use the outer go.mod of your project, or you can use '--mock=false' to disable go mod tidy and mockgen completely, if you are very curious, here's the explanation: Most of the errors are basically caused by the mockgen tool. Before executing mockgen, it requires running go mod tidy, which in turn needs a valid go.mod file. However, this go.mod file can have various issues, especially when your project already has an existing go.mod file. Therefore, using the '--nogomod' flag to disable the generation of a new go.mod file can solve the problem, or using the '--mock=false' flag can resolve the issue even more effectively (but there won't be any mock files generated :( ). Please run "trpc -h" or "trpc create -h" (or "trpc {some-other-subcommand} -h") for help messages.The text was updated successfully, but these errors were encountered: