Skip to content

Go generic generation improvements #1404

Closed

Description

@baywet

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.

Activity

  1. baywet commented on Mar 16, 2022

    @baywet
    MemberAuthor

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

  2. baywet commented on Mar 17, 2022

    @baywet
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Goenhancementfixed

Type

No type

Projects

  • Status
    Done ✔️

Relationships

None yet

Development

No branches or pull requests

Issue actions