#things printed to stdout by a method are

1 messages · Page 1 of 1 (latest)

young crescent
#

specifically things fmt.Println and the like

#

Example ...

$ dagger call go-test
▶ connect 0.2s
▶ load module: . 7.2s
● parsing command line arguments 0.0s

● eventSchemas(
  ┆ src: Host.directory(path: "/Users/emuller/devel/xyz/foo-bar", exclude: [], noCache: true): Directory!
  ): ThingThing! 0.2s
▶ .goTest: Void 12.7s

goTest there has output that I want to see (but not return) ...

I guess I could return it though

#

The problem with outputting it is that it then makes it hard to reuse the same method in a chain ... but I guess it could be wrapped

static oxide
#

This is something I run into constantly too. I sometimes end up passing -v to the dagger CLI when I want to see the results. Most of the time, I don't care about the actual report when I run locally. I care about it when it fails, but dagger then prints the error.

You could also have the function return a custom struct and attach additional methods for printing reports etc. This module has a good example - https://github.com/dagger/dagger/blob/main/modules/golangci/lint.go#L191.

young crescent
#

true that.

#

for now I'll just use a strings.Builder and return a (string, error)

#

I do with dagger would keep things output to stdout (and/or stderr) on the screen though by default (or at least configurably)

#

*wish

young crescent
#

hmm --progress dots may give me what I want

#

more or less yep