Hello! I have a module I'm working on where the error in some function returns isn't showing up in function signatures when trying to call functions from a test module. I've narrowed down a reproducible segment of the code to the below (the module is named debian). Any idea what I might be doing wrong?
// File used to store the Debian snapshot time
const (
SNAPSHOT_FILE string = "DEBIAN_SNAPSHOT"
)
// Entrypoint for Dagger module
type Debian struct {
// Metadata directory
MetadataDir *dagger.Directory
}
func New(
// +optional
metadataDir *dagger.Directory,
) *Debian {
return &Debian{
MetadataDir: metadataDir,
}
}
func (m *Debian) NewDebianBuilder(ctx context.Context) (*DebianImageBuilder, error) {
exists, err := m.MetadataDir.Exists(ctx, SNAPSHOT_FILE)
if err != nil {
return nil, err
}
if exists {
return newDebianImageBuilder(m.MetadataDir.File(SNAPSHOT_FILE)), nil
}
return newDebianImageBuilder(nil), nil
}
// Builder object used to create Debian-based images. Currently only supports Debian proper, not Ubuntu
type DebianImageBuilder struct {
// This points to a file that contains the default snapshot time to use if an explicit timestamp is not provided
// +private
SnapshotFile *dagger.File
// Which major version of Debian to use for the image
DebVersion int
// An explicit timestamp to use for all apt operations. If not provided the SnapshotFile will be read
// +private
providedSnapshotTime string
// Whether or not to use the distroless variant of the specific Debian version. Note, distroless is only available for released versions and only for the most recent two major versions
// +private
isDistroless bool
}
func newDebianImageBuilder(
SnapshotFile *dagger.File,
) *DebianImageBuilder {
return &DebianImageBuilder{
SnapshotFile: SnapshotFile,
DebVersion: getDefaultDebianVersion(),
}
}