8000 mockgen cannot load Go 1.27 packages with export data version 5 · Issue #331 · uber-go/mock · GitHub
[go: up one dir, main page]

Skip to content

mockgen cannot load Go 1.27 packages with export data version 5 #331

Backlog

Description

@EtienneM

Actual behavior mockgen 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 behavior mockgen 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 repro
 
import "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

Triage Notes for the Maintainers

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0