-
Notifications
You must be signed in to change notification settings - Fork 57
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
"undeclared name" while loading package #71
Comments
I had the same problem. After moving my Go code into the proper location (a directory under $GOPATH/src), the problem went away. |
That's not necessarily the proper location for code that's versioned using Go modules. I'm having this problem in libraries that are built this way. |
Yes, it does seem that go-mutesting doesn't really support projects with Go modules and this needs to be fixed. The only way I've found to work around this problem is to copy the Go code into a directory under GO111MODULE=off go get -t -v .
GO111MODULE=on go-mutesting . When creating mutants, go-mutesting temporarily modifies the source code in-place, so copying the source code to another directory has the added benefit of ensuring that those mutations are not kept if go-mutesting terminates prematurely. |
It seems like it would be wise to copy the code to a temporary folder before creating the mutants ... should this be another issue? |
this was fixed for me by using the fork from #77 |
Hi,
I've got an error while executing the following command:
newConfigError is in my scenario a function defined in the same package, but in another file.
Playing with the code, I found out here that you are only loading one file if importPath is equal to ".".
As only one file is loaded (instead of all go files in the module), every entities not present in the same file raised exception.
Replacing
conf.CreateFromFilenames(dir, fileAbs)
withconf.Import(buildPkg.ImportPath)
in parse.go solved my problem, but I'm not sure that the best thing to do as I don't really know the inner logic...The text was updated successfully, but these errors were encountered: