Skip to content

Commit

Permalink
fix: remove comparable constraint from Optional (#6041)
Browse files Browse the repository at this point in the history
* fix: remove comparable constraint from Optional

This allows making slice types (`[]any`) optional, which is permitted at
the API level, but wasn't allowed at the type constraint level.

We previously used this constraint because it was assumed that a user
might constraint an Optional manually, and not set `isSet`. However,
this is an edge case that pokes into the private internals of
`dagger.gen.go`, and we now have the `Opt` helper for this. Users doing
this kind of access should be aware of what they're doing.

Signed-off-by: Justin Chadwell <me@jedevc.com>

* feat: add OptEmpty helper to Go SDK

This creates an empty optional - note that the type constraint cannot be
automatically derived, at least in the current version of Go.

Signed-off-by: Justin Chadwell <me@jedevc.com>

---------

Signed-off-by: Justin Chadwell <me@jedevc.com>
  • Loading branch information
jedevc committed Nov 1, 2023
1 parent dbf26a1 commit 1c7f522
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions dagger.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1c7f522

Please sign in to comment.