cast protobuf enum return 0
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4k
- Forks
- 337
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Description
version: 1.5 1.3
test.proto
enum N {
DEFAULT = 0;
ONE = 1;
}
message Test {
N num = 1;
}
main.go
a := &pb.Test{ Num: 123 }
cast.toInt32(a) //return 0
int32(a) //return 123
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the test.proto and main.go examples, then trace cast.toInt32 for the protobuf enum field. Reproduce the difference between cast.toInt32(a) and int32(a), and consider the issue done when the cast returns the enum's numeric value rather than 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100