Skip to content

Instantly share code, notes, and snippets.

@tommady
Created November 28, 2018 10:07
Show Gist options
  • Save tommady/09f4c1459730c1e013a7a66153222d00 to your computer and use it in GitHub Desktop.
Save tommady/09f4c1459730c1e013a7a66153222d00 to your computer and use it in GitHub Desktop.
ret := new(pb.Reply)
if x, ok := in.Arg.GetKind().(*structpb.Value_StringValue); ok {
s := x.StringValue + “ Generic!!!”
ret.Ret = &structpb.Value{
Kind: &structpb.Value_StringValue{
StringValue: s
}
}
} else if x, ok := in.Arg.GetKind().(*structpb.Value_NumberValue); ok {
i := x.NumberValue + 3345678
ret.Ret = &structpb.Value{
Kind: &structpb.Value_NumberValue{
NumberValue: i
}
}
}
return ret, nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment