What is the issue?
When I created a module constructor with // +optional=true missing flag returned a pointer of the empty object instead of nil.
Example Code:
package main
func New(
// +optional=true
src *Directory,
) *A {
return &A{Src: src}
}
type A struct {
Src *Directory
}
func (m *A) IsEmpty() bool {
return m.Src == nil
}
Log output
dagger call is-empty
✔ dagger call is-empty [1.38s]
┃ false
• Cloud URL: https://dagger.cloud/runs/6ed9327f-a4e3-4257-9864-87733b642a5f
• Engine: 64fae4326b32 (version v0.9.4)
⧗ 2.79s ✔ 31 ∅ 7
Steps to reproduce
The code from example can be used for reproducing the issue.
SDK version
GO SDK v0.9.4
OS version
macOS 14.0
cc: @jedevc
What is the issue?
When I created a module constructor with
// +optional=truemissing flag returned a pointer of the empty object instead of nil.Example Code:
Log output
dagger call is-empty ✔ dagger call is-empty [1.38s] ┃ false • Cloud URL: https://dagger.cloud/runs/6ed9327f-a4e3-4257-9864-87733b642a5f • Engine: 64fae4326b32 (version v0.9.4) ⧗ 2.79s ✔ 31 ∅ 7Steps to reproduce
The code from example can be used for reproducing the issue.
SDK version
GO SDK v0.9.4
OS version
macOS 14.0
cc: @jedevc