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

PredicateVar doesn't support slices #94

Closed
Multiply opened this issue Feb 9, 2024 · 6 comments · Fixed by #96
Closed

PredicateVar doesn't support slices #94

Multiply opened this issue Feb 9, 2024 · 6 comments · Fixed by #96
Assignees
Labels
bug Something isn't working

Comments

@Multiply
Copy link
Contributor

Multiply commented Feb 9, 2024

https://github.com/labd/commercetools-go-sdk/blob/6167676b8af29d6b2c10e73f64505e43eec08743/platform/client_product_projections_by_project_key_product_projections_get.go#L97C4-L97C20

Is there a reason the following line is using .Set over .Add?

It's impossible to use slices of input when it overrides every time in the loop. It results in only the last value being sent to the API.

@Multiply Multiply added bug Something isn't working triage Needs triage labels Feb 9, 2024
@Multiply
Copy link
Contributor Author

Multiply commented Feb 9, 2024

Looking through more files, this seems to be the case for most, if not all occurrences of PredicateVar.

@mvantellingen
Copy link
Member

Good question; the code is generated with rmf-codegen (we are the maintainer of the go part), see https://github.com/commercetools/rmf-codegen/blob/main/languages/go/src/main/kotlin/io/vrap/codegen/languages/go/client/MethodRenderer.kt#L153

@Multiply
Copy link
Contributor Author

Multiply commented Feb 9, 2024

Good question; the code is generated with rmf-codegen (we are the maintainer of the go part), see https://github.com/commercetools/rmf-codegen/blob/main/languages/go/src/main/kotlin/io/vrap/codegen/languages/go/client/MethodRenderer.kt#L153

From the looks of it, changing it to .Add shouldn't break any tests, right?

@demeyerthom demeyerthom removed the triage Needs triage label Feb 20, 2024
@demeyerthom demeyerthom self-assigned this Feb 20, 2024
@demeyerthom
Copy link
Member

@Multiply I opened a PR there to fix it: commercetools/rmf-codegen#310. As soon as that gets merged I will update the sdk here and let you know!

@Multiply
Copy link
Contributor Author

Thank you so much, @demeyerthom! 🚀

@Multiply
Copy link
Contributor Author

Thanks for the swift fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants