Skip to content
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

cast protobuf enum return 0 #163

Open
zibber2015 opened this issue Dec 14, 2022 · 0 comments
Open

cast protobuf enum return 0 #163

zibber2015 opened this issue Dec 14, 2022 · 0 comments

Comments

@zibber2015
Copy link

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

@zibber2015 zibber2015 changed the title cannot cast protobuf enum return 0 cast protobuf enum return 0 Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant