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

Go generic generation improvements #1404

Closed
Tracked by #1
baywet opened this issue Mar 16, 2022 · 2 comments · Fixed by #1848
Closed
Tracked by #1

Go generic generation improvements #1404

baywet opened this issue Mar 16, 2022 · 2 comments · Fixed by #1848
Assignees
Labels
enhancement New feature or request fixed Go

Comments

@baywet
Copy link
Member

baywet commented Mar 16, 2022

With the release of go 1.18 generics are now available for go.
One of the common complain we have with the SDKs are that it takes long to compile, deterring some of our usage.

With generics, we may have an opportunity to reduce the amount of code we generate, improving the experience for everyone, and we should investigate.

One common pattern that'd be good to reduce, is looping to recast collections in deserialization (primitives, enums, complex models).

Note: this pattern is also present for serialization

While we're at it, we might want to revalidate whether checking for nil for the function receiver is necessary in getters and setters and either remove this (is it actually possible to call a function with nil?) or expand it to the other methods that access fields (get deserializers, serializer, etc...)

Lastly, evaluating the IsNil function for removal would also be beneficial.

@baywet baywet added enhancement New feature or request Go labels Mar 16, 2022
@baywet baywet added this to the Community Preview milestone Mar 16, 2022
@baywet baywet self-assigned this Mar 16, 2022
@baywet baywet added this to Kiota Mar 16, 2022
@baywet baywet moved this to Todo in Kiota Mar 16, 2022
@baywet
Copy link
Member Author

baywet commented Mar 16, 2022

Another avenue for improvement would be the SendAsync methods to avoid having to cast after getting the result

@baywet
Copy link
Member Author

baywet commented Mar 17, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed Go
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants