Slide 12
Slide 12 text
S mp e ui d
func build(repoUrl string) error {
...
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
...
repo := client.Git(repoUrl)
src, err := repo.Branch("main").Tree().ID(ctx)
workdir := client.Host().Workdir()
for _, version := range goVersions {
for _, goos := range oses {
for _, goarch := range arches {
goos, goarch, version := goos, goarch, version
g.Go(func() error {
...
build := golang.WithEnvVariable("GOOS", goos)
build = build.WithEnvVariable("GOARCH", goarch)
build = build.Exec(dagger.ContainerExecOpts{
Args: []string{"go", "build", "-o", path},
})
output, err := build.Directory(path).ID(ctx)
...
})
}
}
}
...
L v P c (@a ) - M P #9, 3 .1 . 2 1