You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session
8000
.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mockgen cannot load Go 1.27 packages with export data version 5 #331
Actual behaviormockgen fails to load packages in a Go 1.27 module and exits with:
2026/11/24 14:27:31 Loading input failed: extract interfaces from package: internal error in importing "example.com/mockgen-repro" (cannot decode "example.com/mockgen-repro", export data version 5 is greater than maximum supported version 4); please report an issue
Expected behaviormockgen loads the packages and generates the requested mocks.
To Reproduce Steps to reproduce the behavior
mkdir -p /tmp/mockgen-repro/bin
cd /tmp/mockgen-repro
go mod init example.com/mockgen-repro
go mod edit -go=1.27.3
cat > service.go <<'EOF'package reproimport "context"type Service interface { Do(context.Context) error}EOF
GOBIN=/tmp/mockgen-repro/bin go install go.uber.org/mock/mockgen@main
/tmp/mockgen-repro/bin/mockgen -destination=mock_service.go -package=repro . Service
Additional Information
gomock mode (reflect or source): package mode
gomock version or git ref: go.uber.org/mock v0.6.1-0.20260825235954-d8c3a2a4df48 (@main); binary reports golang.org/x/tools v0.48.0
golang version: Go 1.27.4; also reproduced with Go 1.27.3
Activity