Hi ! I'm trying to understand a bit how dagger works and I have soem trouble to get a file out of the container.
package main
import (
"context"
)
type Potato struct{}
func (m *Potato) Scan(ctx context.Context, host string, dir *Directory) {
return dag.Container().
From("projectdiscovery/nuclei:latest").
WithExec([]string{"-u", host, "-o", "out.json","-j"}).
Directory(".").
Export(ctx, ".").
Stdout(ctx)
}
dagger --debug call scan --host=honey.scanme.sh --dir=./out
Stderr:
# main
./main.go:10:9: multiple-value dag.Container().From("projectdiscovery/nuclei:latest").WithExec([]string{…}).Directory(".").Export(ctx, ".") (value of type (bool, error)) in single-value context
I do not understand the issue. The answer is probably pretty clear with the error, but I can't figure it out.