-
Notifications
You must be signed in to change notification settings - Fork 63
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
failpoint doesn't work if the marker function is defined in the main package #33
Comments
In production environment it's unlikely for the failpoint users to define a marker function in package main, But I think people incline to use such a simple test program to try failpint at first glimpse as I have done. |
@lonng as we've discussed yesterday. |
There is an imperfect solution here. |
@lonng Yes.... if we want to solve this thoroughly, maybe there's one method, but I'm not sure if its graceful.
|
@spongedu I don't think put the generated files in |
So what about the extra import: import "reflect" ? |
@spongedu Oops |
Bug Report
Please answer these questions before submitting your issue. Thanks!
For example, we have a file named main.go:
After transfrom the code with
failpoint-ctl enable
, the generatedbinding__failpoint_binding__.go
looks like this:You may notice that
binding__failpoint_binding__.go
is also in packagemain
, that meansbinding__failpoint_binding__.go
could not be found bymain.go
.Run
go run main.go
then, you will find the following error:program panics due to failpoint
$ ./bin/failpoint-ctl -V
ReleaseVersion bf45ab2
BuildTS 2019-05-15 09:48:44
GitHash bf45ab2
GitBranch master
GoVersion go version go1.12 darwin/amd64
The text was updated successfully, but these errors were encountered: