I'm trying to have some reusable code in a simple go module. Not a dagger module, just a regular library.
I've created the following:
dag-common/common.go
dag-common/go.mod
dag-common/go.sum
mod1/dagger.json
mod1/go.mod
mod1/go.sum
mod1/main.go
dag-common has a dagger.io/dagger dependency.
mod1 is a dagger module and has a dag-common dependency.
mod1 declares a function called apt-install which uses code from dag-common
This doesn't quite work though, because the types provided by codegen to mod1 aren't quite the same as the ones from dagger.io/dagger used by dag-common.
So when I run dagger call -m mod1 call apt-install --packages=curl I get an error:
./main.go:27:52: cannot use dagCommon.AptInstall(packages) (value of func type "dagger.io/dagger".WithContainerFunc) as "dagger/mod-1/internal/dagger".WithContainerFunc value in argument to dag
.Container().From("ubuntu:latest").With
Is this scenario supported?
I have the example here: https://github.com/idlsoft/dagger-example-1