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

Support pointers to structs in the go-runtime #259

Closed
alecthomas opened this issue Aug 22, 2023 · 1 comment
Closed

Support pointers to structs in the go-runtime #259

alecthomas opened this issue Aug 22, 2023 · 1 comment

Comments

@alecthomas
Copy link
Collaborator

Currently every time must be a value type, not a pointer. This is annoying.

@alecthomas alecthomas added this to the V0 - Staging dev release milestone Aug 22, 2023
@alecthomas alecthomas self-assigned this Aug 22, 2023
@alecthomas alecthomas added this to FTL Aug 22, 2023
@alecthomas alecthomas moved this to Todo in FTL Aug 22, 2023
@wesbillman wesbillman removed this from the V0 - Staging dev release milestone Oct 10, 2023
@alecthomas
Copy link
Collaborator Author

To be honest, I'm not sure this is a good idea, as requiring values prevents an entire class of errors and reduces confusion. What I mean by this is that if you have a struct like this:

type MyRequest struct {
  Name string
  Address *Address
}

Does a pointer indicate optional, or just that we want to use a pointer?

It is somewhat annoying having to type out in function return values, that's for sure. Another option could be to only allow pointers in request/response structs.

@alecthomas alecthomas removed their assignment Feb 12, 2024
@github-actions github-actions bot added the triage Issue needs triaging label Feb 12, 2024
@alecthomas alecthomas removed the triage Issue needs triaging label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants