Skip to content

cast protobuf enum return 0 #163

@zibber2015

Description

@zibber2015

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions