bazel-contrib / bazel-contrib/rules_go

Rules_go 0.47.0 downgraded the gomock dependency from 1.7.0-rc1 to 1.6.0, which broke support for generics in mocks

Open
#3,930 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

### What version of rules_go are you using?

0.47.0

### What version of gazelle are you using?

0.36.0

### What version of Bazel are you using?

6.5.0

### Does this issue reproduce with the latest releases of all the above?

Mocks using generics are broken, as the gomock lib downgrade has no support for generics.

### What operating system and processor architecture are you using?

Linux amd64, Darwin arm64

### What did you do?

We have several mocks generated from cloud provider interfaces using generics, which with the latest rules_go fail as gomock 1.6.0 can not handle generics correctly.

### What did you expect to see?

Mocks generated under rules_go 0.46.0 worked as expected.

### What did you see instead?

A error message
failed parsing returns: don't know how to parse type *ast.IndexExpr

Contributor guide

Open the contributing guide

Research direction

Start by checking the rules_go 0.47.0 dependency declarations and comparing the gomock version with rules_go 0.46.0. Reproduce generation of a mock using a generic cloud-provider interface and verify that the `failed parsing returns: don't know how to parse type *ast.IndexExpr` error is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.