-
Notifications
You must be signed in to change notification settings - Fork 412
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
mockery Error parsing file could not import golang.org/x/sync/semaphore (invalid package name: \"\") #514
Comments
did you fix it ? I have the same issue |
add this to go.sum golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= fixed. |
Seeing the same with aws sdk
go.sum:
Any ideas how to fix this? |
this is super frustrating, but is often solved by running a |
|
have a try with |
When running into this issue, please try using one of the binary distributions of mockery. A lot of these issues happen because of dependency issues in your go module, which is why |
I get this error with |
Running Example: |
If others could confirm if that solution above works, I'll add it to the FAQ ^ |
using docker run --rm \
-v "${PWD}:/src" \
-v "${PWD}/scripts/mockery.yaml:/mockery.yaml" \
-v "${GOPATH:-$HOME/go}/pkg/mod:/go/pkg/mod" \
-w /src \
--user "$(id -u):$(id -g)" \
vektra/mockery \
--config="/mockery.yaml" |
|
thanks @j1cs |
I found this question while googling this very error occurring in one of my org's private repos, and it turns out I was using the wrong Github secret key to give access to my other private repos within my GitHub Action. (lol feel like a dummy after wasting 30 mins trying different random solutions before realizing I had the wrong key the whole time) |
@LandonTClipp seems like we can close the issue as #824 has been merged. |
golang version go1.17.6 linux/amd64
mockery dry-run=false version=v2.9.4
go.mod
require
golang.org/x/sync v0.1.0
go mod download
log.go
import (
"golang.org/x/sync/semaphore"
)
mockery --all --inpackage --keeptree --output /root/baisheng/
27 Oct 22 07:32 UTC INF Starting mockery dry-run=false version=v2.9.4
27 Oct 22 07:32 UTC INF Walking dry-run=false version=v2.9.4
27 Oct 22 07:33 UTC ERR Error parsing file error="/root/baisheng/ git/ log.go:11:2: could not import golang.org/x/sync/semaphore (invalid package name: \" \")" dry-run=false version=v2.9.4
The text was updated successfully, but these errors were encountered: