-
Notifications
You must be signed in to change notification settings - Fork 7
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
Need Help with Collections #32
Comments
Fix code to make it viewable: practiceArray := []*proto.Value{
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[0])}},
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[1])}},
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[2])}},
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[3])}},
}
var testCollection = &proto.Value_Collection{Collection: {Elements: practiceArray}}
print(testCollection) |
This is the fix:
Full code (w/ fix): practiceArray := []*proto.Value{
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[0])}},
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[1])}},
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[2])}},
{Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[3])}},
}
testCollection := &proto.Value_Collection{Collection: &proto.Collection{Elements: practiceArray}}
print(testCollection) |
The protobuf type can be quite verbose and can be a bit difficult to use. This project is working toward making the Go gRPC API easier to use: https://github.com/datastax-ext/astra-go-sdk. It's still early days, but maybe give it a try! |
Hi I was wondering if someone could tell me what I am doing wrong here, the compiler tells me "missing type in composite literal" however, I don't know what do to fix it. I'm still kind of new to Go, gRPC, and protocol buffers. Code Snippet Below
practiceArray := []*proto.Value{ {Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[0])}}, {Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[1])}}, {Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[2])}}, {Inner: &proto.Value_Int{Int: int64(data.M_suspensionPosition[3])}}, } var testCollection = &proto.Value_Collection{Collection: {Elements: practiceArray}} print(testCollection)
The text was updated successfully, but these errors were encountered: