#dagger.gen issues using interface returning a non core type

1 messages · Page 1 of 1 (latest)

polar egret
#

Defining an interface which returns a non Dagger core type as for example bool, causes the code generation to fail:

./dagger.gen.go:161:21: too many return values                have (bool, nil)                                      want (bool)                                   
./dagger.gen.go:166:19: too many return values
        have (bool, error)
        want (bool)                        
./dagger.gen.go:166:29: undefined: ctx

Repo containing the example code from the interfaces documentation:
https://github.com/puzzle/dagger-interface-example

GitHub

Contribute to puzzle/dagger-interface-example development by creating an account on GitHub.

bronze hedge
polar egret
#

@bronze hedge so in Go boolis a scalar? The same error occurs, if I switch the return type to string.

bronze hedge
#

if you use scalars, you need to add acontext.Context argument and return error to the interface function

#

the same way you did it for the Foo function